diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-30 22:22:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 22:22:46 +0100 |
commit | 4889b806984ce454f906f066c8b3f63c7efa401e (patch) | |
tree | e63480d73c93a933f1c83903b6041743d07e964d /scene/gui | |
parent | 6a11e8c3773d27f1a7531b16324edbf1c803ed43 (diff) | |
parent | 7683ff3e42539a24bc333573e271e2ae77eb5c61 (diff) |
Merge pull request #12471 from mhilbrunner/autocomplete
Fix get_node() and $ autocompletion when using single quotes
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index acf6d55eb5..2d55c077f1 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4489,7 +4489,13 @@ void TextEdit::_update_completion_candidates() { completion_index = 0; completion_base = s; Vector<float> sim_cache; + bool single_quote = s.begins_with("'"); + for (int i = 0; i < completion_strings.size(); i++) { + if (single_quote && completion_strings[i].is_quoted()) { + completion_strings[i] = completion_strings[i].unquote().quote("'"); + } + if (s == completion_strings[i]) { // A perfect match, stop completion _cancel_completion(); |