void (@NotNull Editor editor) { super.onEditorAdded(editor); editor.getCaretModel().addCaretListener(new CaretListener() { @Override public void caretPositionChanged(@NotNull CaretEvent event) { final int offset = editor.logicalPositionToOffset(event.getNewPosition()); highlightRegExpGroup(offset, regExpFile); } }, disposable); }