auto-completion edge jump

arrow up/down jumps to end/start on edges

(cherry picked from commit e36dd4282b)
This commit is contained in:
Alexander Holland 2018-03-08 03:47:42 +01:00 committed by Hein-Pieter van Braam
parent b5a55810c5
commit 259b9664ef
1 changed files with 10 additions and 4 deletions

View File

@ -2141,9 +2141,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (completion_index > 0) { if (completion_index > 0) {
completion_index--; completion_index--;
completion_current = completion_options[completion_index]; } else {
update(); completion_index = completion_options.size() - 1;
} }
completion_current = completion_options[completion_index];
update();
accept_event(); accept_event();
return; return;
} }
@ -2152,9 +2155,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (completion_index < completion_options.size() - 1) { if (completion_index < completion_options.size() - 1) {
completion_index++; completion_index++;
completion_current = completion_options[completion_index]; } else {
update(); completion_index = 0;
} }
completion_current = completion_options[completion_index];
update();
accept_event(); accept_event();
return; return;
} }