From 7e6bc72f7cfa210f756cda60a8a3e9516470f04d Mon Sep 17 00:00:00 2001 From: Arman Elgudzhyan <48544263+puchik@users.noreply.github.com> Date: Sun, 5 Mar 2023 18:04:07 -0800 Subject: [PATCH] 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) --- scene/gui/code_edit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index ee39327d4d1..91c4fa37612 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 completion_options_casei; Vector completion_options_substr; Vector completion_options_substr_casei;