diff --git a/apps/code/variable_box_controller.cpp b/apps/code/variable_box_controller.cpp index d99e7aa9c..aba82d4a5 100644 --- a/apps/code/variable_box_controller.cpp +++ b/apps/code/variable_box_controller.cpp @@ -624,8 +624,13 @@ void VariableBoxController::loadCurrentVariablesInScript(const char * scriptCont * nameLength are temporary variables that will be overriden when the * lexer continues lexing or is destroyed. * This was found from stepping in the code and trying. */ + /* TODO: Try to understand what is happening with tokenInText and + * remove this trick.*/ + while (*tokenInText == ' ') { + tokenInText++; + } for (int i = 0; i < 3; i++) { - if (strncmp(tokenInText, name, nameLength) != 0) { + if (strncmp(tokenInText, name, nameLength) != 0 && tokenInText > scriptContent) { tokenInText--; } else { break;