mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
Update console after IPython detection and fix Console folding (PY-25468)
This commit is contained in:
@@ -371,8 +371,7 @@ def get_interpreter():
|
||||
except AttributeError:
|
||||
interpreterInterface = InterpreterInterface(None, None, threading.currentThread())
|
||||
setattr(__builtin__, 'interpreter', interpreterInterface)
|
||||
sys.stderr.write(interpreterInterface.get_greeting_msg())
|
||||
sys.stderr.flush()
|
||||
print(interpreterInterface.get_greeting_msg())
|
||||
|
||||
return interpreterInterface
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class PyConsoleStartFolding implements ConsoleCommunicationListener, FoldingListener, DocumentListener {
|
||||
private PythonConsoleView myConsoleView;
|
||||
private int myNumberOfCommandExecuted = 0;
|
||||
private int myNumberOfCommandToStop = 1;
|
||||
private int myNumberOfCommandToStop = 2;
|
||||
private boolean doNotAddFoldingAgain = false;
|
||||
private FoldRegion myStartFoldRegion;
|
||||
private static final String DEFAULT_FOLDING_MESSAGE = "Python Console";
|
||||
|
||||
@@ -87,7 +87,7 @@ open class PydevConsoleExecuteActionHandler(private val myConsoleView: LanguageC
|
||||
consoleComm.execInterpreter(code) {}
|
||||
}
|
||||
|
||||
private fun updateConsoleState() {
|
||||
override fun updateConsoleState() {
|
||||
if (!isEnabled) {
|
||||
executingPrompt()
|
||||
}
|
||||
|
||||
@@ -29,4 +29,5 @@ abstract class PythonConsoleExecuteActionHandler(processHandler: ProcessHandler,
|
||||
abstract fun canExecuteNow(): Boolean
|
||||
abstract var isEnabled: Boolean
|
||||
abstract val consoleCommunication: ConsoleCommunication
|
||||
abstract fun updateConsoleState()
|
||||
}
|
||||
@@ -295,6 +295,7 @@ public class PythonConsoleView extends LanguageConsoleImpl implements Observable
|
||||
VirtualFile file = getVirtualFile();
|
||||
if (PyConsoleUtil.detectIPythonImported(text, outputType)) {
|
||||
PyConsoleUtil.markIPython(file);
|
||||
getExecuteActionHandler().updateConsoleState();
|
||||
}
|
||||
if (PyConsoleUtil.detectIPythonAutomagicOn(text)) {
|
||||
PyConsoleUtil.setIPythonAutomagic(file, true);
|
||||
|
||||
Reference in New Issue
Block a user