If command executed but is incomplete and more lines are needed prompt shouldn't be changed to ordinary one in this case.

This commit is contained in:
Dmitry Trofimov
2013-11-21 13:17:20 +01:00
parent 56e038568a
commit 2ddfd6a817
7 changed files with 19 additions and 15 deletions

View File

@@ -215,7 +215,7 @@ class BaseInterpreterInterface:
try:
self.startExec()
more = self.doAddExec(code_fragment)
self.finishExec()
self.finishExec(more)
finally:
if help is not None:
try:
@@ -358,13 +358,13 @@ class BaseInterpreterInterface:
else:
return None
def finishExec(self):
def finishExec(self, more):
self.interruptable = False
server = self.get_server()
if server is not None:
return server.NotifyFinished()
return server.NotifyFinished(more)
else:
return True

View File

@@ -57,9 +57,9 @@ public abstract class AbstractConsoleCommunication implements ConsoleCommunicati
}
@Override
public void notifyCommandExecuted() {
public void notifyCommandExecuted(boolean more) {
for (ConsoleCommunicationListener listener: communicationListeners) {
listener.commandExecuted();
listener.commandExecuted(more);
}
}

View File

@@ -24,7 +24,7 @@ public interface ConsoleCommunication {
void addCommunicationListener(ConsoleCommunicationListener listener);
void notifyCommandExecuted();
void notifyCommandExecuted(boolean more);
void notifyInputRequested();
class ConsoleCodeFragment {

View File

@@ -4,6 +4,6 @@ package com.jetbrains.python.console.pydev;
* @author traff
*/
public interface ConsoleCommunicationListener {
void commandExecuted();
void commandExecuted(boolean more);
void inputRequested();
}

View File

@@ -169,7 +169,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
*/
public Object execute(String method, Vector params) throws Exception {
if ("NotifyFinished".equals(method)) {
return execNotifyFinished();
return execNotifyFinished((Boolean)params.get(0));
}
else if ("RequestInput".equals(method)) {
return execRequestInput();
@@ -225,9 +225,9 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
return Boolean.FALSE;
}
private Object execNotifyFinished() {
private Object execNotifyFinished(boolean more) {
setExecuting(false);
notifyCommandExecuted();
notifyCommandExecuted(more);
return true;
}

View File

@@ -181,6 +181,7 @@ public class PydevConsoleExecuteActionHandler extends ConsoleExecuteActionHandle
indentEditor(currentEditor, indent);
more(console, currentEditor);
myConsoleCommunication.notifyCommandExecuted(true);
return;
}
}
@@ -271,10 +272,13 @@ public class PydevConsoleExecuteActionHandler extends ConsoleExecuteActionHandle
}
@Override
public void commandExecuted() {
final LanguageConsoleImpl console = myConsoleView.getConsole();
final Editor currentEditor = console.getConsoleEditor();
ordinaryPrompt(console, currentEditor);
public void commandExecuted(boolean more) {
if (!more) {
final LanguageConsoleImpl console = myConsoleView.getConsole();
final Editor currentEditor = console.getConsoleEditor();
ordinaryPrompt(console, currentEditor);
}
}
@Override

View File

@@ -385,7 +385,7 @@ public class PythonConsoleView extends JPanel implements LanguageConsoleView, Ob
final XStandaloneVariablesView view = new XStandaloneVariablesView(myProject, new PyDebuggerEditorsProvider(), stackFrame);
consoleCommunication.addCommunicationListener(new ConsoleCommunicationListener() {
@Override
public void commandExecuted() {
public void commandExecuted(boolean more) {
view.rebuildView();
}