diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java index 90b84f8819e2..63f76aa7da98 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java @@ -1218,19 +1218,19 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse @Nullable public EditorMouseEventArea getEditorMouseAreaByOffset(int offset) { - if (offset < getAnnotationsAreaOffset()) { + if (isLineNumbersShown() && offset < getLineNumberAreaOffset() + getLineNumberAreaWidth()) { return EditorMouseEventArea.LINE_NUMBERS_AREA; } - if (offset < getAnnotationsAreaOffset() + getAnnotationsAreaWidth()) { + if (isAnnotationsShown() && offset < getAnnotationsAreaOffset() + getAnnotationsAreaWidth()) { return EditorMouseEventArea.ANNOTATIONS_AREA; } - if (offset < getFoldingAreaOffset()) { + if (isLineMarkersShown() && offset < getFoldingAreaOffset()) { return EditorMouseEventArea.LINE_MARKERS_AREA; } - if (offset < getFoldingAreaOffset() + getFoldingAreaWidth()) { + if (isFoldingOutlineShown() && offset < getFoldingAreaOffset() + getFoldingAreaWidth()) { return EditorMouseEventArea.FOLDING_OUTLINE_AREA; }