void (@NotNull EditorEx editor, @NotNull Document document, int startLine, int endLine, boolean matched) { removeLineMarkers(editor); if (startLine >= endLine || endLine >= document.getLineCount()) return; int startOffset = document.getLineStartOffset(startLine); int endOffset = document.getLineEndOffset(endLine); LineMarkerRenderer renderer = createLineMarkerRenderer(matched); RangeHighlighter highlighter = editor.getMarkupModel() .addRangeHighlighterAndChangeAttributes(null, startOffset, endOffset, 0, HighlighterTargetArea.LINES_IN_RANGE, false, h -> h.setLineMarkerRenderer(renderer)); editor.putUserData(LINE_MARKER_IN_EDITOR_KEY, highlighter); }