void (Graphics g, RangeHighlighterEx segmentHighlighter, int startLineNumber, int endLineNumber) { if (!segmentHighlighter.isValid()) { return; } if (segmentHighlighter.isAfterEndOfLine()) { int startOffset = segmentHighlighter.getStartOffset(); int visibleStartLine = offsetToVisualPosition(startOffset).line; if (!getFoldingModel().isOffsetCollapsed(startOffset)) { if (visibleStartLine >= startLineNumber && visibleStartLine <= endLineNumber) { int logStartLine = offsetToLogicalPosition(startOffset).line; LogicalPosition logPosition = offsetToLogicalPosition(myDocument.getLineEndOffset(logStartLine)); Point end = logicalPositionToXY(logPosition); int charWidth = getSpaceWidth(Font.PLAIN); int lineHeight = getLineHeight(); TextAttributes attributes = segmentHighlighter.getTextAttributes(); if (attributes != null && attributes.getBackgroundColor() != null) { g.setColor(attributes.getBackgroundColor()); g.fillRect(end.x, end.y, charWidth, lineHeight); } if (attributes != null && attributes.getEffectColor() != null) { int y = visibleLineNumberToYPosition(visibleStartLine) + getLineHeight() - getDescent() + 1; g.setColor(attributes.getEffectColor()); if (attributes.getEffectType() == EffectType.WAVE_UNDERSCORE) { drawWave(g, end.x, end.x + charWidth - 1, y); } else if (attributes.getEffectType() != EffectType.BOXED) { g.drawLine(end.x, y, end.x + charWidth - 1, y); } } } } } }