void (List<? extends TextRange> ranges, Editor editor, ArrayList<RangeHighlighter> highlighters) { EditorColorsManager colorsManager = EditorColorsManager.getInstance(); final TextAttributes attributes = colorsManager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES); final HighlightManager highlightManager = HighlightManager.getInstance(editor.getProject()); for (final TextRange range : ranges) { highlightManager.addOccurrenceHighlight(editor, range.getStartOffset(), range.getEndOffset(), attributes, 0, highlighters, null); } for (RangeHighlighter highlighter : highlighters) { highlighter.setGreedyToLeft(true); highlighter.setGreedyToRight(true); } }