On 02/17/2012 09:48 AM, Michael Hill wrote: > Snippets worked this morning, then I updated: > > Traceback (most recent call last): > File "/usr/lib64/gedit/plugins/snippets/document.py", line 824, in > on_view_key_press > return self.run_snippet() > File "/usr/lib64/gedit/plugins/snippets/document.py", line 671, in > run_snippet > if not self.run_snippet_trigger(word, (start, end)): > File "/usr/lib64/gedit/plugins/snippets/document.py", line 651, in > run_snippet_trigger > cm.show([self.provider], cm.create_context()) > File "/usr/lib64/python2.7/site-packages/gi/types.py", line 43, in > function > return info.invoke(*args, **kwargs) > TypeError: create_context() takes exactly 2 arguments (1 given) I have seen this recently in Ubuntu Precise and recognised the error. I recently update gedit-developer-plugins which provides completions as well. While http://developer.gnome.org/gtksourceview/stable/GtkSourceCompletion.html indicate that the position argument is optional, it is required. The context return was not correct. I could easily create my own context and that allowed me to show the completions. I think there is a more graceful way to handle this. Instead of constructing the completion, context, and calling show, the view can emit a signal: cm = self.view.get_completion() cm.show([self.provider], cm.create_context()) Becomes self.view.emit('show-completion') There may be an undesirable secondary effect. Other providers may appear. In my case, when gdp's proposals appeared with snippets in the completion window, I called woot! and declared myself done. -- __C U R T I S C. H O V E Y_______ Guilty of stealing everything I am.
Attachment:
signature.asc
Description: OpenPGP digital signature