mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PyCharm doesn't allow to finish input (PY-27881)
Update communication after console view creation and add check for nullability
This commit is contained in:
@@ -108,7 +108,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
|
||||
private PythonDebugConsoleCommunication myDebugCommunication;
|
||||
private boolean myNeedsMore = false;
|
||||
|
||||
private PythonConsoleView myConsoleView;
|
||||
private @Nullable PythonConsoleView myConsoleView;
|
||||
private List<PyFrameListener> myFrameListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
|
||||
/**
|
||||
@@ -234,7 +234,9 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
|
||||
return execNotifyAboutMagic(params);
|
||||
}
|
||||
else if ("ShowConsole".equals(method)) {
|
||||
myConsoleView.setConsoleEnabled(true);
|
||||
if (myConsoleView != null) {
|
||||
myConsoleView.setConsoleEnabled(true);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
@@ -401,7 +403,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
|
||||
return; //TODO: handle text input and other cases
|
||||
}
|
||||
nextResponse = null;
|
||||
if (waitingForInput && myConsoleView.isInitialized()) {
|
||||
if (waitingForInput && myConsoleView != null && myConsoleView.isInitialized()) {
|
||||
inputReceived = command.getText();
|
||||
waitingForInput = false;
|
||||
//the thread that we started in the last exec is still alive if we were waiting for an input.
|
||||
@@ -791,7 +793,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
|
||||
}
|
||||
}
|
||||
|
||||
public void setConsoleView(PythonConsoleView consoleView) {
|
||||
public void setConsoleView(@Nullable PythonConsoleView consoleView) {
|
||||
myConsoleView = consoleView;
|
||||
}
|
||||
|
||||
|
||||
@@ -607,8 +607,9 @@ public class PydevConsoleRunnerImpl implements PydevConsoleRunner {
|
||||
// Init console view
|
||||
myConsoleView = createConsoleView();
|
||||
if (myConsoleView != null) {
|
||||
((JComponent)myConsoleView).setBorder(new SideBorder(JBColor.border(), SideBorder.LEFT));
|
||||
myConsoleView.setBorder(new SideBorder(JBColor.border(), SideBorder.LEFT));
|
||||
}
|
||||
myPydevConsoleCommunication.setConsoleView(myConsoleView);
|
||||
myProcessHandler = createProcessHandler(process);
|
||||
|
||||
myConsoleExecuteActionHandler = createExecuteActionHandler();
|
||||
|
||||
Reference in New Issue
Block a user