int (EditorMouseEvent event) { Editor editor = event.getEditor(); if (editor instanceof EditorEx && editor.getProject() != null && event.getArea() == EditorMouseEventArea.EDITING_AREA && event.getMouseEvent().getModifiers() == 0 && event.isOverText() && event.getCollapsedFoldRegion() == null) { return event.getOffset(); } return -1; }