void (MarkupModelEx markupModel) { myGraphics.translate(0, myYShift); markupModel.processRangeHighlightersOverlappingWith(myStartOffset, myEndOffset, highlighter -> { CustomHighlighterRenderer customRenderer = highlighter.getCustomRenderer(); if (customRenderer != null) { if (myClipDetector.rangeCanBeVisible(highlighter.getStartOffset(), highlighter.getEndOffset())) { switch (customRenderer.getOrder()) { case BEFORE_BACKGROUND -> customRenderer.paint(myEditor, highlighter, myGraphics); case AFTER_BACKGROUND -> myAfterBackgroundCustomHighlighters.add(highlighter); case AFTER_TEXT -> myForegroundCustomHighlighters.add(highlighter); } } } return true; }); myGraphics.translate(0, -myYShift); }