[gedit] snippets: let the default handler manage the position of the completion window.



commit 9f6ea03608f6afc216bec243249d7fb170ff0b6d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Oct 11 00:12:50 2011 +0200

    snippets: let the default handler manage the position of the completion window.
    
    For some reason when we return the iter of the place of where the window
    should be placed we get a warning that the iter is invalid.
    pygobject bug? maybe the annotation should be inout?

 plugins/snippets/snippets/completion.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/snippets/snippets/completion.py b/plugins/snippets/snippets/completion.py
index cdc0850..c12513e 100644
--- a/plugins/snippets/snippets/completion.py
+++ b/plugins/snippets/snippets/completion.py
@@ -87,11 +87,15 @@ class Provider(GObject.Object, GtkSource.CompletionProvider):
                 else:
                         return None
 
-        def do_get_start_iter(self, context, proposal, iter):
+        def do_get_start_iter(self, context, proposal):
+                # FIXME: until we figure out what is wrong that we are getting
+                # and invalid iter all the time we can survice with this.
+                return (False, None)
+
                 if not self.mark or self.mark.get_deleted():
-                        return None
+                        return (False, None)
 
-                return self.mark.get_buffer().get_iter_at_mark(self.mark)
+                return (True, self.mark.get_buffer().get_iter_at_mark(self.mark))
 
         def do_match(self, context):
                 return True



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