[latexila] Delete some TextMark from their buffer



commit 4d870f6c724e3b1979b6734291c5532bf10da5ce
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Thu Jan 19 00:04:59 2012 +0100

    Delete some TextMark from their buffer

 src/completion.vala |    5 +++++
 src/latex_menu.vala |    6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/completion.vala b/src/completion.vala
index 639c5f7..a941869 100644
--- a/src/completion.vala
+++ b/src/completion.vala
@@ -495,14 +495,19 @@ public class CompletionProvider : GLib.Object, SourceCompletionProvider
         string indent = document.tab.view.get_indentation_style ();
 
         doc.insert (ref iter, @"\n$current_indent$indent", -1);
+
         if (environment != null && environment.insert != null)
             doc.insert (ref iter, environment.insert, -1);
+
         TextMark cursor_pos = doc.create_mark (null, iter, true);
+
         if (environment != null && environment.insert_after != null)
             doc.insert (ref iter, environment.insert_after, -1);
+
         doc.insert (ref iter, @"\n$current_indent\\end{" + env_name + "}", -1);
 
         doc.get_iter_at_mark (out iter, cursor_pos);
+        doc.delete_mark (cursor_pos);
         doc.place_cursor (iter);
     }
 
diff --git a/src/latex_menu.vala b/src/latex_menu.vala
index 5494e56..83fa9df 100644
--- a/src/latex_menu.vala
+++ b/src/latex_menu.vala
@@ -499,7 +499,8 @@ public class LatexMenu : Gtk.ActionGroup
             active_document.insert (ref end, text_after2 ?? text_after, -1);
 
             active_document.get_iter_at_mark (out end, mark_end);
-            active_document.select_range (end, end);
+            active_document.delete_mark (mark_end);
+            active_document.place_cursor (end);
         }
 
         // no selection
@@ -519,7 +520,8 @@ public class LatexMenu : Gtk.ActionGroup
             active_document.insert_at_cursor (text_after2 ?? text_after, -1);
 
             active_document.get_iter_at_mark (out between, mark);
-            active_document.select_range (between, between);
+            active_document.delete_mark (mark);
+            active_document.place_cursor (between);
         }
 
         active_document.end_user_action ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]