mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public interface ConsoleCommunication {
|
||||
|
||||
void addCommunicationListener(ConsoleCommunicationListener listener);
|
||||
|
||||
void notifyCommandExecuted();
|
||||
void notifyCommandExecuted(boolean more);
|
||||
void notifyInputRequested();
|
||||
|
||||
class ConsoleCodeFragment {
|
||||
|
||||
@@ -4,6 +4,6 @@ package com.jetbrains.python.console.pydev;
|
||||
* @author traff
|
||||
*/
|
||||
public interface ConsoleCommunicationListener {
|
||||
void commandExecuted();
|
||||
void commandExecuted(boolean more);
|
||||
void inputRequested();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user