[latexila] Figure insertion: swap \label and \caption
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [latexila] Figure insertion: swap \label and \caption
- Date: Thu,  3 May 2012 17:01:27 +0000 (UTC)
commit 46f5eced6797f020aa14a425091a8cd05ec85fa6
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Thu May 3 18:55:24 2012 +0200
    Figure insertion: swap \label and \caption
    
    This fixes bug #675344:
    https://bugzilla.gnome.org/show_bug.cgi?id=675344
    
    Thanks for the bug report!
 src/latex_menu.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/latex_menu.vala b/src/latex_menu.vala
index 77ace23..bf32a60 100644
--- a/src/latex_menu.vala
+++ b/src/latex_menu.vala
@@ -653,17 +653,19 @@ public class LatexMenu : Gtk.ActionGroup
     {
         string indent = get_indentation ();
 
-        string begin = @"\\begin{figure}\n" +
+        string before_cursor =
+            "\\begin{figure}\n" +
             @"$indent\\begin{center}\n" +
             @"$indent$indent\\includegraphics{";
 
-        string end = @"}\n" +
-            @"$indent$indent\\label{fig:}\n" +
+        string after_cursor =
+            "}\n" +
             @"$indent$indent\\caption{}\n" +
+            @"$indent$indent\\label{fig:}\n" +
             @"$indent\\end{center}\n" +
             "\\end{figure}";
 
-        text_buffer_insert (begin, end);
+        text_buffer_insert (before_cursor, after_cursor);
     }
 
     public void on_env_table ()
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]