diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index 4470cf0be..d4236663a 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -154,17 +154,11 @@ int VariableBoxController::typeAtLocation(int i, int j) { } void VariableBoxController::loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength) { + assert(scriptIndex >= 0); + // Reset the node counts empty(); - if (scriptIndex < 0) { - /* If not script index is given, the variable box is loaded from console. We - * only want to load imported script variables. */ - assert(textToAutocomplete == nullptr); - loadVariablesImportedFromScripts(); - return; - } - if (textToAutocomplete != nullptr && textToAutocompleteLength < 0) { textToAutocompleteLength = strlen(textToAutocomplete); }