Update console after IPython detection and fix Console folding (PY-25468)

This commit is contained in:
Elizaveta Shashkova
2017-08-02 20:06:00 +03:00
parent 1cbd3a4692
commit 94de8b61f8
5 changed files with 5 additions and 4 deletions
+1 -2
View File
@@ -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);