diff options
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index c702bc70d0..9a8dc62e4e 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2200,9 +2200,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { k->set_shift(false); } - if (!k->get_command()) { - _reset_caret_blink_timer(); - } + _reset_caret_blink_timer(); // save here for insert mode, just in case it is cleared in the following section bool had_selection = selection.active; @@ -5770,8 +5768,11 @@ void TextEdit::_update_completion_candidates() { } // Calculate the similarity to keep completions in good order float similarity; - if (completion_strings[i].to_lower().begins_with(s.to_lower())) { - // Substrings are the best candidates + if (completion_strings[i].begins_with(s)) { + // Substrings (same case) are the best candidates + similarity = 1.2; + } else if (completion_strings[i].to_lower().begins_with(s.to_lower())) { + // then any substrings similarity = 1.1; } else { // Otherwise compute the similarity |