From bffd4f0548c8dc3e1e5f597995232c549018a50c Mon Sep 17 00:00:00 2001 From: robfram Date: Tue, 6 Mar 2018 19:25:14 +0100 Subject: [PATCH] Fix bad autocomplete of partially written node paths when using syntactic sugar notation ($) If you had a tree like Node2D->Sprite->Camera2D and you write a code like $Node2D/Spr and chose the autocompletion sugested Node2D/Sprite, the resulting string was $Node2D/Node2D/Sprite instead $Node2D/Sprite. If you chose Node2D/Sprite/Camera2D, then you ended with $Node2D/Node2D/Sprite/Camera2D. Fix #15813. (cherry picked from commit 95f186b62184c846571c7278842ac4923f461d5a) --- scene/gui/text_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f9946bf4bb0..48bd733e805 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5238,7 +5238,7 @@ void TextEdit::_update_completion_candidates() { } else { - while (cofs > 0 && l[cofs - 1] > 32 && _is_completable(l[cofs - 1])) { + while (cofs > 0 && l[cofs - 1] > 32 && (l[cofs - 1] == '/' || _is_completable(l[cofs - 1]))) { s = String::chr(l[cofs - 1]) + s; if (l[cofs - 1] == '\'' || l[cofs - 1] == '"' || l[cofs - 1] == '$') break;