diff options
author | Arman Elgudzhyan <48544263+puchik@users.noreply.github.com> | 2023-03-05 18:04:07 -0800 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-13 21:35:23 +0100 |
commit | 7e6bc72f7cfa210f756cda60a8a3e9516470f04d (patch) | |
tree | 0c3bd89c825ecc790b532bd71b38a7d8c6a6df75 /scene | |
parent | 13b37a50aed6d305de1f78c156d046cf971ae25f (diff) |
Don't autocomplete numbers in GDScript
Cancel code autocompletion when a numerical value is entered. Avoids interference when setting numbers.
(cherry picked from commit 688d00b70645a822ba694b13bcdb312e74d8c034)
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/code_edit.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index ee39327d4d..91c4fa3761 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -2926,6 +2926,12 @@ void CodeEdit::_filter_code_completion_candidates_impl() { code_completion_options.clear(); code_completion_base = string_to_complete; + /* Don't autocomplete setting numerical values. */ + if (code_completion_base.is_numeric()) { + cancel_code_completion(); + return; + } + Vector<ScriptLanguage::CodeCompletionOption> completion_options_casei; Vector<ScriptLanguage::CodeCompletionOption> completion_options_substr; Vector<ScriptLanguage::CodeCompletionOption> completion_options_substr_casei; |