summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-03-13 12:01:14 +0100
committerGitHub <noreply@github.com>2018-03-13 12:01:14 +0100
commit6d97fbdfc16b6df34119df7829e97b1060643483 (patch)
tree66b4a577583d10171acbc556f848281048bd797a /scene/gui/text_edit.cpp
parent6d59bc67a0dd8828eb95f33339054b1555e64380 (diff)
parente36dd4282b2c4a5b2f2b00e57ee347c4fcd14e71 (diff)
Merge pull request #17359 from AlexHolly/completion-edge-jump
Auto completion edge jump
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;
}