mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not move caret if clicked on the gutter inside the foldings area
This commit is contained in:
@@ -4314,6 +4314,11 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isInsideGutterOnlyFoldingArea(@NotNull MouseEvent e) {
|
||||||
|
EditorMouseEventArea area = getMouseEventArea(e);
|
||||||
|
return area == EditorMouseEventArea.FOLDING_OUTLINE_AREA &&
|
||||||
|
myGutterComponent.convertX(e.getX()) <= myGutterComponent.getWhitespaceSeparatorOffset();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EditorMouseEventArea getMouseEventArea(@NotNull MouseEvent e) {
|
public EditorMouseEventArea getMouseEventArea(@NotNull MouseEvent e) {
|
||||||
@@ -5946,7 +5951,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
|||||||
// are drawn) and annotations area. E.g. we don't want to change caret position if a user sets new break point (clicks
|
// are drawn) and annotations area. E.g. we don't want to change caret position if a user sets new break point (clicks
|
||||||
// at 'line markers' area).
|
// at 'line markers' area).
|
||||||
if (e.getSource() != myGutterComponent ||
|
if (e.getSource() != myGutterComponent ||
|
||||||
eventArea != EditorMouseEventArea.LINE_MARKERS_AREA && eventArea != EditorMouseEventArea.ANNOTATIONS_AREA)
|
(eventArea != EditorMouseEventArea.LINE_MARKERS_AREA &&
|
||||||
|
eventArea != EditorMouseEventArea.ANNOTATIONS_AREA &&
|
||||||
|
!isInsideGutterOnlyFoldingArea(e)))
|
||||||
{
|
{
|
||||||
VisualPosition visualPosition = myUseNewRendering ? getTargetPosition(x, y, true) : null;
|
VisualPosition visualPosition = myUseNewRendering ? getTargetPosition(x, y, true) : null;
|
||||||
LogicalPosition pos = myUseNewRendering ? visualToLogicalPosition(visualPosition) : getLogicalPositionForScreenPos(x, y, true);
|
LogicalPosition pos = myUseNewRendering ? visualToLogicalPosition(visualPosition) : getLogicalPositionForScreenPos(x, y, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user