void (@NotNull final Graphics g, @NotNull Rectangle clip, int clipStartOffset, int clipEndOffset, @NotNull MarkupModelEx docMarkup) { if (myDocument.getLineCount() == 0) return; final int startLine = yPositionToVisibleLine(clip.y); final int endLine = yPositionToVisibleLine(clip.y + clip.height) + 1; Processor<RangeHighlighterEx> paintProcessor = new Processor<RangeHighlighterEx>() { @Override public boolean process(@NotNull RangeHighlighterEx highlighter) { if (!highlighter.getEditorFilter().avaliableIn(EditorImpl.this)) return true; paintSegmentHighlighterAfterEndOfLine(g, highlighter, startLine, endLine); return true; } }; docMarkup.processRangeHighlightersOverlappingWith(clipStartOffset, clipEndOffset, paintProcessor); myMarkupModel.processRangeHighlightersOverlappingWith(clipStartOffset, clipEndOffset, paintProcessor); }