auto-completion edge jump

arrow up/down jumps to end/start on edges
This commit is contained in:
Alexander Holland 2018-03-08 03:47:42 +01:00
parent acacba3fdc
commit e36dd4282b
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--;
} else {
completion_index = completion_options.size() - 1;
}
completion_current = completion_options[completion_index]; completion_current = completion_options[completion_index];
update(); 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++;
} else {
completion_index = 0;
}
completion_current = completion_options[completion_index]; completion_current = completion_options[completion_index];
update(); update();
}
accept_event(); accept_event();
return; return;
} }