Reopening Debugger Console causes IllegalArgumentException (PY-21457)

Add console folding to debug console once
This commit is contained in:
Elizaveta Shashkova
2016-11-15 18:47:03 +03:00
parent 1f4b9f3c78
commit ce8532cda5
2 changed files with 13 additions and 3 deletions
@@ -150,11 +150,18 @@ public class PythonConsoleView extends LanguageConsoleImpl implements Observable
}
}
public boolean isConsoleEnabledFirstTime() {
return myFirstRun && myExecuteActionHandler != null;
}
public void setFirstRun(boolean firstRun) {
myFirstRun = firstRun;
}
public void showStartMessageForFirstExecution(String startCommand) {
if (myFirstRun && myExecuteActionHandler != null) {
setPrompt("");
executeStatement(startCommand + "\n", ProcessOutputTypes.SYSTEM);
myFirstRun = false;
}
}
@@ -73,8 +73,11 @@ public class PythonDebugLanguageConsoleView extends DuplexConsoleView<ConsoleVie
if (!primary && !isPrimaryConsoleEnabled()) {
PythonConsoleView console = getPydevConsoleView();
console.addConsoleFolding(true);
console.showStartMessageForFirstExecution(DEBUG_CONSOLE_START_COMMAND);
if (console.isConsoleEnabledFirstTime()) {
console.addConsoleFolding(true);
console.showStartMessageForFirstExecution(DEBUG_CONSOLE_START_COMMAND);
console.setFirstRun(false);
}
IdeFocusManager.findInstance().requestFocus(console.getConsoleEditor().getContentComponent(), true);
}