From 8a8c172b93982bc530f85a45743fe8e44be5bf0e Mon Sep 17 00:00:00 2001 From: daniel-mcclintock <13973653+daniel-mcclintock@users.noreply.github.com> Date: Mon, 6 Sep 2021 23:10:06 +1000 Subject: [PATCH] Fix crash during completion lookback --- scene/gui/code_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 5f3ab18ccad..955410f8908 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -2744,7 +2744,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { /* If we have a space, previous word might be a keyword. eg "func |". */ } else if (cofs > 0 && line[cofs - 1] == ' ') { int ofs = cofs - 1; - while (ofs >= 0 && line[ofs] == ' ') { + while (ofs > 0 && line[ofs] == ' ') { ofs--; } prev_is_word = _is_char(line[ofs]);