Fixed console history scrolling if there is no focus on editor (PY-2910).
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Mon, 28 Mar 2011 16:29:51 +0000 (20:29 +0400)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Mon, 28 Mar 2011 16:55:37 +0000 (20:55 +0400)
platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java

index 645a4615b2e514420386189f59bdec89193fec0a..d387769681e3f73b3472495e1ac0a8a243eaf280 100644 (file)
@@ -310,7 +310,10 @@ public abstract class AbstractConsoleRunnerWithHistory {
       public Boolean compute() {
         final Document document = consoleEditor.getDocument();
         final CaretModel caretModel = consoleEditor.getCaretModel();
-
+        // Check if we have focus
+        if (!IJSwingUtilities.hasFocus(consoleEditor.getComponent())) {
+          return true;
+        }
         // Check if we have active lookup or if we can move in editor
         return LookupManager.getActiveLookup(consoleEditor) != null ||
                document.getLineNumber(caretModel.getOffset()) < document.getLineCount() - 1 &&