[apps/variable_box_controller] Auto-import: ignore variable when it is

the autocompleted one
This commit is contained in:
Émilie Feral
2020-05-26 17:02:13 +02:00
parent d82e6de6e8
commit 41bb169edd

View File

@@ -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);
}
}