void (@NotNull Editor editor, boolean withSelection) { int offset = getAnchorOffset(); if (offset != -1) { editor.getCaretModel().moveToOffset(offset); editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); } if (withSelection) { final TextRange range = getHighlightRange(); if (range != null) { editor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset()); } } }