diff options
| author | George Marques | 2016-07-03 11:34:23 -0300 |
|---|---|---|
| committer | George Marques | 2016-07-03 11:34:23 -0300 |
| commit | ec18b97f5cdc3fcf67cb2625d289cb061958b2b6 (patch) | |
| tree | ad5a00685534d5af09d56b4f7a98df43325b29ec /scene/gui/text_edit.cpp | |
| parent | 805b668d7f7a5fcddf887e25938f6ee829bd19d8 (diff) | |
| download | godot-ec18b97f5cdc3fcf67cb2625d289cb061958b2b6.tar.gz godot-ec18b97f5cdc3fcf67cb2625d289cb061958b2b6.tar.zst godot-ec18b97f5cdc3fcf67cb2625d289cb061958b2b6.zip | |
Stop completion when the match is perfect
to avoid the completion insisting showing up after a completion.
Diffstat (limited to '')
| -rw-r--r-- | scene/gui/text_edit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 18552c077..40fc9a70c 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4140,6 +4140,11 @@ void TextEdit::_update_completion_candidates() { int ci_match=0; Vector<float> sim_cache; for(int i=0;i<completion_strings.size();i++) { + if (s == completion_strings[i]) { + // A perfect match, stop completion + _cancel_completion(); + return; + } if (s.is_subsequence_ofi(completion_strings[i])) { // don't remove duplicates if no input is provided if (s != "" && completion_options.find(completion_strings[i]) != -1) { |
