mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user