Skip to content

Commit

Permalink
fix: correct debug command's behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 23, 2024
1 parent 1c6e7ba commit e9db611
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/api/EventAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,15 @@ void InitBasicEventListeners() {
return false;
}
#ifdef LLSE_BACKEND_NODEJS
if (!NodeJsHelper::processConsoleNpmCmd(ev.mCommand)) return false;
if (!NodeJsHelper::processConsoleNpmCmd(ev.mCommand)) {
ev.cancel();
return false;
}
#elif defined(LLSE_BACKEND_PYTHON)
if (!PythonHelper::processConsolePipCmd(ev.mCommand)) return false;
if (!PythonHelper::processConsolePipCmd(ev.mCommand)) {
ev.cancel();
return false;
}
#endif
// CallEvents
std::vector<std::string> paras;
Expand All @@ -1391,7 +1397,10 @@ void InitBasicEventListeners() {
return false;
}
} else {
if (isFromOtherEngine) return false;
if (isFromOtherEngine) {
ev.cancel();
return false;
}

// Other Cmd
IF_LISTENED(EVENT_TYPES::onConsoleCmd) { CallEvent(EVENT_TYPES::onConsoleCmd, String::newString(cmd)); }
Expand Down
2 changes: 1 addition & 1 deletion src/main/BuiltinCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern ScriptEngine* debugEngine;
bool ProcessDebugEngine(const std::string& cmd) {
#ifdef LLSE_BACKEND_PYTHON
// process python debug seperately
return PythonHelper::processPythonDebugEngine(cmd;
return PythonHelper::processPythonDebugEngine(cmd);
#endif
if (isInConsoleDebugMode) {
EngineScope enter(debugEngine);
Expand Down

0 comments on commit e9db611

Please sign in to comment.