Godot: Autocomplete behaviour

Created on 27 Aug 2017  路  6Comments  路  Source: godotengine/godot

Operating system or device, Godot version, GPU Model and driver (if graphics related):
Linux 64 bits Godot bd282ff

Issue description:

if you delete a line and the cursor lands on a word in the next line, if you delete characters in the middle of a word and if you uncomment a line while your cursor is on a word the autocomplete popup will show.

Steps to reproduce:
little animated GIFs that demonstrates the behaviour:

  • deleting a line
    deleting a line

  • uncomment a line
    uncommenting a line

  • editing middle of word
    middle of word

What other editors do is something like (using qtcreator as an example):

  • deleting a line
    deleting a line

  • uncomment a line
    uncommenting a line

  • editing middle of word
    middle of word

Link to minimal example project:

bug editor usability

Most helpful comment

What about "Open autocomplete only when the user instigated the cursor move or inserting new text over white space or inserting text just after deleting text." by using white list approach?

All 6 comments

I think a 'generalized' way of putting the problem would be "Don't open autocomplete if the editor forces a cursor location change, only if the user instigated the move"

Does that sound about correct? This could help find a proper solution for #10691

I like it, but i don't know if it will work always, for example, in the case of moving lines up and down, is the user forcing a move, and the autocomplete will pop up.

You mean at the end of a pasted line? That wouldn't be an explicit cursor move I think. It'd be the editor pushing the cursor due to the paste. Was that what you meant?

with (alt + arrow keys) you can move lines of code up and down and that will also trigger autocomplete.

(edit: deleted, after reading didn't make any sense.)

@hpvb you're logic sounds good, the only thing i would add is "Don't open autocomplete if the editor forces a cursor location change, only if the user instigated the move and inserting new text.", this doesn't cover the editing in the middle of the word, but that's the least annoying.

What about "Open autocomplete only when the user instigated the cursor move or inserting new text over white space or inserting text just after deleting text." by using white list approach?

@hubbyist i have a different approach in my computer, i'll upload to github.

In text_edit there's a text operation type, and if the autocomplete only starts when the text operation is insert works really good.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SleepProgger picture SleepProgger  路  3Comments

EdwardAngeles picture EdwardAngeles  路  3Comments

mefihl picture mefihl  路  3Comments

RayKoopa picture RayKoopa  路  3Comments

gonzo191 picture gonzo191  路  3Comments