From 41bb169edd4bf2d306bd351edce1ed519bf122f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 26 May 2020 17:02:13 +0200 Subject: [PATCH] [apps/variable_box_controller] Auto-import: ignore variable when it is the autocompleted one --- apps/code/variable_box_controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index afedcc09b..09bce9f87 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -615,7 +615,7 @@ void VariableBoxController::loadCurrentVariablesInScript(const char * scriptCont assert(strncmp(tokenInText, name, nameLength) == 0); ScriptNode::Type nodeType = (defToken || *(tokenInText + nameLength) == '(')? ScriptNode::Type::WithParentheses : ScriptNode::Type::WithoutParentheses; - if (shouldAddNode(textToAutocomplete, textToAutocompleteLength, name, nameLength, nodeType, origin)) { + if (tokenInText != textToAutocomplete && shouldAddNode(textToAutocomplete, textToAutocompleteLength, name, nameLength, nodeType, origin)) { addNode(nodeType, origin, tokenInText, nameLength); } }