void (@NotNull Editor editor, int start, int end, @Nullable TextAttributes forcedAttributes, @Nullable TextAttributesKey attributesKey, int flags, @Nullable Collection<? super RangeHighlighter> outHighlighters, @Nullable Color scrollMarkColor) { MarkupModelEx markupModel = (MarkupModelEx)editor.getMarkupModel(); markupModel.addRangeHighlighterAndChangeAttributes(attributesKey, start, end, OCCURRENCE_LAYER, HighlighterTargetArea.EXACT_RANGE, false, highlighter -> { Set<RangeHighlighter> highlighters = getEditorHighlighters(editor, true); highlighters.add(highlighter); setHideFlags(highlighter, flags); highlighter.setVisibleIfFolded(true); if (outHighlighters != null) { outHighlighters.add(highlighter); } if (forcedAttributes != null) { highlighter.setTextAttributes(forcedAttributes); } if (scrollMarkColor != null) { highlighter.setErrorStripeMarkColor(scrollMarkColor); } }); }