[gedit] Use the TeplBuffer::tepl-cursor-moved signal



commit b938c50f898b8f83e08b149f7da9c8a7d6a7e2ae
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Nov 14 11:42:15 2020 +0100

    Use the TeplBuffer::tepl-cursor-moved signal

 gedit/gedit-window.c                  |  2 +-
 plugins/snippets/snippets/document.py | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 8a5bdbcf6..2f9a2076f 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -1885,7 +1885,7 @@ on_tab_added (GeditMultiNotebook *multi,
                          G_CALLBACK (bracket_matched_cb),
                          window);
        g_signal_connect (doc,
-                         "cursor-moved",
+                         "tepl-cursor-moved",
                          G_CALLBACK (update_cursor_position_statusbar),
                          window);
        g_signal_connect (doc,
diff --git a/plugins/snippets/snippets/document.py b/plugins/snippets/snippets/document.py
index 23df28091..003237d17 100644
--- a/plugins/snippets/snippets/document.py
+++ b/plugins/snippets/snippets/document.py
@@ -162,13 +162,13 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
         buf = self.view.get_buffer()
 
         self.connect_signal(buf, 'changed', self.on_buffer_changed)
-        self.connect_signal(buf, 'cursor-moved', self.on_buffer_cursor_moved)
+        self.connect_signal(buf, 'tepl-cursor-moved', self.on_buffer_cursor_moved)
         self.connect_signal_after(buf, 'insert-text', self.on_buffer_insert_text)
 
     def last_snippet_removed(self):
         buf = self.view.get_buffer()
         self.disconnect_signal(buf, 'changed')
-        self.disconnect_signal(buf, 'cursor-moved')
+        self.disconnect_signal(buf, 'tepl-cursor-moved')
         self.disconnect_signal(buf, 'insert-text')
 
     def current_placeholder(self):
@@ -559,7 +559,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
             self.goto_placeholder(current, None)
 
         if len(self.active_snippets) > 0:
-            self.block_signal(buf, 'cursor-moved')
+            self.block_signal(buf, 'tepl-cursor-moved')
 
         buf.begin_user_action()
 
@@ -569,7 +569,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
         # Insert the snippet
         if len(self.active_snippets) == 0:
             self.first_snippet_inserted()
-            self.block_signal(buf, 'cursor-moved')
+            self.block_signal(buf, 'tepl-cursor-moved')
 
         sn = s.insert_into(self, start)
         self.active_snippets.append(sn)
@@ -585,7 +585,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals):
         else:
             self.goto_placeholder(self.active_placeholder, sn.placeholders[keys[0]])
 
-        self.unblock_signal(buf, 'cursor-moved')
+        self.unblock_signal(buf, 'tepl-cursor-moved')
 
         if sn in self.active_snippets:
             # Check if we can get end_iter in view without moving the


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