Transaction guards
[idea/community.git] / python / src / com / jetbrains / python / console / PythonConsoleToolWindowFactory.kt
index 3f22047efdd5d983030d0bd12be3623753517964..5179228976ea1e6f21082df315b8f1c731ea7b24 100644 (file)
@@ -16,6 +16,7 @@
 package com.jetbrains.python.console
 
 import com.intellij.execution.console.LanguageConsoleView
+import com.intellij.openapi.application.TransactionGuard
 import com.intellij.openapi.project.DumbAware
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.wm.ToolWindow
@@ -28,7 +29,7 @@ class PythonConsoleToolWindowFactory : ToolWindowFactory, DumbAware {
 
   override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
     val runner = PythonConsoleRunnerFactory.getInstance().createConsoleRunner(project, null)
-    runner.runSync()
+    TransactionGuard.submitTransaction(project, Runnable { runner.runSync() });
   }
 
   companion object {