Save documents in EDT in console.

This commit is contained in:
Dmitry Trofimov
2014-03-23 22:45:18 +02:00
parent 84a28b9b77
commit 3da109d99f
@@ -190,8 +190,13 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory<PythonC
}
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
FileDocumentManager.getInstance().saveAllDocuments();
}
});
myPorts = findAvailablePorts(getProject(), myConsoleType);
assert myPorts != null;
@@ -336,10 +341,10 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory<PythonC
commandLine.getParametersList().set(3, "0");
myCommandLine = commandLine.getCommandLineString();
try {
RemoteSdkCredentials remoteCredentials = data.getRemoteSdkCredentials();
RemoteSshProcess remoteProcess =
manager.createRemoteProcess(getProject(), remoteCredentials, commandLine, true);
@@ -349,7 +354,7 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory<PythonC
remoteProcess.addLocalTunnel(myPorts[0], remoteCredentials.getHost(), remotePorts.first);
remoteProcess.addRemoteTunnel(remotePorts.second, "localhost", myPorts[1]);
myPydevConsoleCommunication = new PydevConsoleCommunication(getProject(), myPorts[0], remoteProcess, myPorts[1]);
return remoteProcess;
}