Fix IDEA-123157 Unnecessary scrolling in Editor Color Dialog (typo fix in line 226...
authorAlexey Utkin <alexey.utkin@jetbrains.com>
Mon, 31 Mar 2014 07:56:29 +0000 (11:56 +0400)
committerAlexey Utkin <alexey.utkin@jetbrains.com>
Mon, 31 Mar 2014 07:57:24 +0000 (11:57 +0400)
platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java

index e7e92ca98401e1c86875086ac3de2791ad3aff74..6f54db66fbf8fe893beff7971f40ac38bbd24e79 100644 (file)
@@ -133,12 +133,7 @@ public class SimpleEditorPreview implements PreviewPanel{
     if (highlighter != null) {
       HighlighterIterator itr = ((EditorEx)editor).getHighlighter().createIterator(offset);
       selectItem(itr, highlighter, select);
-      if (!select) {
-        ClickNavigator.setCursor(editor, Cursor.HAND_CURSOR);
-      }
-      else {
-        ClickNavigator.setCursor(editor, Cursor.TEXT_CURSOR);
-      }
+      ClickNavigator.setCursor(editor, select ? Cursor.TEXT_CURSOR : Cursor.HAND_CURSOR);
     }
   }
 
@@ -201,7 +196,7 @@ public class SimpleEditorPreview implements PreviewPanel{
       String type = ((EditorSchemeAttributeDescriptor)description).getType();
 
       List<HighlightData> highlights = startBlinkingHighlights(myEditor,
-                                                                         myHighlightData, type,
+                                                               myHighlightData, type,
                                                                myPage.getHighlighter(), true,
                                                                myBlinkingAlarm, BLINK_COUNT, myPage);
 
@@ -228,7 +223,7 @@ public class SimpleEditorPreview implements PreviewPanel{
   private static boolean isOffsetVisible(final Editor editor, final int startOffset) {
     Rectangle visibleArea = editor.getScrollingModel().getVisibleArea();
     Point point = editor.logicalPositionToXY(editor.offsetToLogicalPosition(startOffset));
-    return point.y >= visibleArea.y && point.y < visibleArea.x + visibleArea.height;
+    return point.y >= visibleArea.y && point.y < (visibleArea.y + visibleArea.height);
   }
 
   private void stopBlinking() {