From 259b9664ef407d8b4dc7e049f8e31967ff8a08f7 Mon Sep 17 00:00:00 2001 From: Alexander Holland Date: Thu, 8 Mar 2018 03:47:42 +0100 Subject: [PATCH] auto-completion edge jump arrow up/down jumps to end/start on edges (cherry picked from commit e36dd4282b2c4a5b2f2b00e57ee347c4fcd14e71) --- scene/gui/text_edit.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 95d9173d399..f9946bf4bb0 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2141,9 +2141,12 @@ void TextEdit::_gui_input(const Ref &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 &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; }