giobauermeister / gedit-pair-char-autocomplete

Automatically exported from code.google.com/p/gedit-pair-char-autocomplete
1 stars 0 forks source link

Problems with autocompletion #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Enable gedit word autocompletion
2. write a word that's autocompleted and press enter
3. autcompletion fails and line break is added instead
This doesn't happen with gedit-pair-char disabled.

I already figured out what line in pair_char_completion.py is causing it and 
fixed the problem by replacing 
if not handled and event.keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter):
with
if not handled and event.keyval in (Gdk.KEY_KP_Enter):
in line 273. All functionally still exists after this only the above mentioned 
bug is gone.

Version 1.0.6 (tested in Gedit 3.10.4)

Would be nice if you could provide a fix to solve this problem for others too.

Original issue reported on code.google.com by steffl.h...@gmail.com on 13 Feb 2014 at 8:47

GoogleCodeExporter commented 8 years ago
Thanks for the bug report. I can't reproduce this in the version of Gedit I 
have here (3.2.6), so it must only occur in the later versions. I'll look into 
it when I get access to a machine with a newer Gedit on it.

By the way, the reason the Gdk.KEY_Return is in there is so that if you do this:

function x() {<return>}

you get something like this:

function x() {
<cursor>
}

i.e. two new lines are inserted and the indentation is preserved. Does this 
still work with your fix?

Original comment by kevin.mcguinness@gmail.com on 13 Feb 2014 at 10:15