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
This commit is contained in:
Dmitry Batrak
2016-04-22 19:20:58 +03:00
parent 1a17663127
commit 9c0948ebcf
@@ -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);
}