summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorAlexander Holland <alexander.holland@live.de>2018-03-08 03:47:42 +0100
committerAlexander Holland <alexander.holland@live.de>2018-03-09 17:31:07 +0100
commite36dd4282b2c4a5b2f2b00e57ee347c4fcd14e71 (patch)
tree5afe666387a178a36dabf501ae89c1b17be6da0d /scene/gui/text_edit.cpp
parentacacba3fdccceb1a627aff99c1e24384e52065ef (diff)
auto-completion edge jump
arrow up/down jumps to end/start on edges
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 95d9173d39..f9946bf4bb 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2141,9 +2141,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (completion_index > 0) {
completion_index--;
- completion_current = completion_options[completion_index];
- update();
+ } else {
+ completion_index = completion_options.size() - 1;
}
+ completion_current = completion_options[completion_index];
+ update();
+
accept_event();
return;
}
@@ -2152,9 +2155,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (completion_index < completion_options.size() - 1) {
completion_index++;
- completion_current = completion_options[completion_index];
- update();
+ } else {
+ completion_index = 0;
}
+ completion_current = completion_options[completion_index];
+ update();
+
accept_event();
return;
}