From 9c0948ebcf90b20e466f064ca4f0441a76f723db Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 22 Apr 2016 18:55:50 +0300 Subject: [PATCH] fix drag behaviour when mouse press point is on gutter side of folding area earlier for such a click mouse movement has been disabled (see commit 670e628), but we must also remember a line where click was made in this case, to move caret there if mouse press is continued with a drag, just like it's done when initial mouse press is inside gutter icons area --- .../src/com/intellij/openapi/editor/impl/EditorImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 1c41c4cf2770..361a49b9fe74 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 @@ -4413,7 +4413,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi return; } - if (getMouseEventArea(e) == EditorMouseEventArea.LINE_MARKERS_AREA) { + EditorMouseEventArea eventArea = getMouseEventArea(e); + if (eventArea == EditorMouseEventArea.LINE_MARKERS_AREA || + eventArea == EditorMouseEventArea.FOLDING_OUTLINE_AREA && !isInsideGutterWhitespaceArea(e)) { // The general idea is that we don't want to change caret position on gutter marker area click (e.g. on setting a breakpoint) // but do want to allow bulk selection on gutter marker mouse drag. However, when a drag is performed, the first event is // a 'mouse pressed' event, that's why we remember target line on 'mouse pressed' processing and use that information on @@ -5857,7 +5859,8 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi myExpectedCaretOffset = -1; } - if (event.getArea() == EditorMouseEventArea.LINE_MARKERS_AREA) { + if (event.getArea() == EditorMouseEventArea.LINE_MARKERS_AREA || + event.getArea() == EditorMouseEventArea.FOLDING_OUTLINE_AREA && !isInsideGutterWhitespaceArea(e)) { myDragOnGutterSelectionStartLine = EditorUtil.yPositionToLogicalLine(EditorImpl.this, e); }