[gedit-latex] snippetmanager: insert text normally if the snippets plugin is not enabled.



commit 112da0204a579f88ca3324bcf0eb148bc33a5f56
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Oct 5 18:48:35 2011 +0200

    snippetmanager: insert text normally if the snippets plugin is not enabled.

 latex/snippetmanager.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/latex/snippetmanager.py b/latex/snippetmanager.py
index d5e5730..7cba311 100644
--- a/latex/snippetmanager.py
+++ b/latex/snippetmanager.py
@@ -37,6 +37,12 @@ class SnippetManager(Singleton):
             # FIXME: we miss the iter
             bus.send('/plugins/snippets', 'parse-and-activate',
                      trigger=text, view=view)
+        else:
+            buf = view.get_buffer()
+
+            buf.begin_user_action()
+            buf.insert(iter, text)
+            buf.end_user_action()
 
     def insert_at_cursor(self, editor, text):
         buf = editor.tab_decorator.tab.get_document()



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