void (TextRange r, int level, TextAttributesKey key) { MarkupModel markupModel = myEditor.getMarkupModel(); RangeHighlighter highlighter = markupModel.addRangeHighlighter(key, r.getStartOffset(), r.getEndOffset(), level, HighlighterTargetArea.EXACT_RANGE); myActiveHighliters.add(highlighter); }