do not set breakpoints if clicked to the right of the gutter separator line

This commit is contained in:
Egor.Ushakov
2014-10-14 19:20:32 +04:00
parent e1a0a06ca3
commit 67f1289e18
@@ -276,7 +276,7 @@ public class XLineBreakpointManager {
|| mouseEvent.isMetaDown() || mouseEvent.isControlDown()
|| mouseEvent.getButton() != MouseEvent.BUTTON1
|| MarkupEditorFilterFactory.createIsDiffFilter().avaliableIn(editor)
|| (e.getArea() != EditorMouseEventArea.LINE_MARKERS_AREA && e.getArea() != EditorMouseEventArea.FOLDING_OUTLINE_AREA)
|| !isInsideGutter(e, editor)
|| ConsoleViewUtil.isConsoleViewEditor(editor)
|| !isFromMyProject(editor)
|| (editor.getSelectionModel().hasSelection() && myDragDetected)
@@ -318,6 +318,13 @@ public class XLineBreakpointManager {
}
});
}
private boolean isInsideGutter(EditorMouseEvent e, Editor editor) {
if (e.getArea() != EditorMouseEventArea.LINE_MARKERS_AREA && e.getArea() != EditorMouseEventArea.FOLDING_OUTLINE_AREA) {
return false;
}
return e.getMouseEvent().getX() <= ((EditorEx)editor).getGutterComponentEx().getWhitespaceSeparatorOffset();
}
}
private boolean isFromMyProject(@NotNull Editor editor) {