void (@NotNull final Project project, @NotNull final SimpleMatch match, @NotNull final Editor editor, Map<SimpleMatch, RangeHighlighter> highlighterMap) { final List<RangeHighlighter> highlighters = new ArrayList<>(); final HighlightManager highlightManager = HighlightManager.getInstance(project); final int startOffset = match.getStartElement().getTextRange().getStartOffset(); final int endOffset = match.getEndElement().getTextRange().getEndOffset(); highlightManager.addRangeHighlight(editor, startOffset, endOffset, EditorColors.SEARCH_RESULT_ATTRIBUTES, true, highlighters); highlighterMap.put(match, highlighters.get(0)); final LogicalPosition logicalPosition = editor.offsetToLogicalPosition(startOffset); editor.getScrollingModel().scrollTo(logicalPosition, ScrollType.MAKE_VISIBLE); }