void (@NotNull Graphics g, @NotNull RangeHighlighterEx segmentHighlighter, int startLine, int endLine) { if (!segmentHighlighter.isAfterEndOfLine()) { return; } int startOffset = segmentHighlighter.getStartOffset(); int visibleStartLine = offsetToVisualLine(startOffset); if (getFoldingModel().isOffsetCollapsed(startOffset)) { return; } if (visibleStartLine >= startLine && visibleStartLine <= endLine) { int logStartLine = offsetToLogicalLine(startOffset); if (logStartLine >= myDocument.getLineCount()) { return; } LogicalPosition logPosition = offsetToLogicalPosition(myDocument.getLineEndOffset(logStartLine)); Point end = logicalPositionToXY(logPosition); int charWidth = EditorUtil.getSpaceWidth(Font.PLAIN, this); int lineHeight = getLineHeight(); TextAttributes attributes = segmentHighlighter.getTextAttributes(); if (attributes != null && getBackgroundColor(attributes) != null) { g.setColor(getBackgroundColor(attributes)); g.fillRect(end.x, end.y, charWidth, lineHeight); } if (attributes != null && attributes.getEffectColor() != null) { int y = visibleLineToY(visibleStartLine) + getAscent() + 1; g.setColor(attributes.getEffectColor()); if (attributes.getEffectType() == EffectType.WAVE_UNDERSCORE) { UIUtil.drawWave((Graphics2D)g, new Rectangle(end.x, y, charWidth - 1, getDescent() - 1)); } else if (attributes.getEffectType() == EffectType.BOLD_DOTTED_LINE) { final int dottedAt = SystemInfo.isMac ? y - 1 : y; UIUtil.drawBoldDottedLine((Graphics2D)g, end.x, end.x + charWidth - 1, dottedAt, getBackgroundColor(attributes), attributes.getEffectColor(), false); } else if (attributes.getEffectType() == EffectType.STRIKEOUT) { int y1 = y - getCharHeight() / 2 - 1; UIUtil.drawLine(g, end.x, y1, end.x + charWidth - 1, y1); } else if (attributes.getEffectType() == EffectType.BOLD_LINE_UNDERSCORE) { drawBoldLineUnderScore(g, end.x, y - 1, charWidth - 1); } else if (attributes.getEffectType() != EffectType.BOXED) { UIUtil.drawLine(g, end.x, y, end.x + charWidth - 1, y); } } } }