From c3fbd93cd81d818bbc77f41fc50295ac0664d242 Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Wed, 14 Mar 2012 19:17:22 +0400 Subject: [PATCH] IDEA-59553 Make it possible to select code blocks via clicks on gutter Tweak editor selection only on 'line numbers' gutter area --- .../src/com/intellij/openapi/editor/impl/EditorImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 4a693d313f25..fb2f5a32ae26 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -5333,15 +5333,14 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi */ private boolean tweakSelectionEvent(@NotNull MouseEvent e) { return getSelectionModel().hasSelection() && e.getButton() == MouseEvent.BUTTON1 && e.isShiftDown() - && e.getComponent() == getGutterComponentEx(); + && getMouseEventArea(e) == EditorMouseEventArea.LINE_NUMBERS_AREA; } /** * Checks if editor selection should be changed because of click at the given point at gutter and proceeds if necessary. *

- * The main idea is that selection can be changed during left mouse clicks with hold Shift button and we want - * to distinguish that situation from 'close line numbers gutter' action (activated by 'Shift+click' - * on gutter area). + * The main idea is that selection can be changed during left mouse clicks on the gutter line numbers area with hold + * Shift button. The selection should be adjusted if necessary. * * @param e event for mouse click on gutter area * @return true if editor's selection is changed because of the click; false otherwise