mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-98684 Setting a breakpoint via mouse also places the caret in this line
This commit is contained in:
@@ -5435,8 +5435,15 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
|
||||
final int oldStart = mySelectionModel.getSelectionStart();
|
||||
final int oldEnd = mySelectionModel.getSelectionEnd();
|
||||
|
||||
moveCaretToScreenPos(x, y);
|
||||
|
||||
// Don't move caret on mouse press above gutter line markers area (a place where break points, 'override', 'implements' etc icons
|
||||
// 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).
|
||||
if (e.getSource() != myGutterComponent
|
||||
|| (eventArea != EditorMouseEventArea.LINE_MARKERS_AREA && eventArea != EditorMouseEventArea.ANNOTATIONS_AREA))
|
||||
{
|
||||
moveCaretToScreenPos(x, y);
|
||||
}
|
||||
|
||||
if (e.isPopupTrigger()) return isNavigation;
|
||||
|
||||
@@ -5486,11 +5493,10 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
}
|
||||
else {
|
||||
int startToUse = oldSelectionStart;
|
||||
int endToUse = caretOffset;
|
||||
if (mySelectionModel.isUnknownDirection() && caretOffset > startToUse) {
|
||||
startToUse = Math.min(oldStart, oldEnd);
|
||||
}
|
||||
mySelectionModel.setSelection(startToUse, endToUse);
|
||||
mySelectionModel.setSelection(startToUse, caretOffset);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user