MarkerRange (@NotNull Editor editor, int startLine, int endLine) { Pair<@NotNull Interval, @Nullable Interval> pair1 = EditorUtil.logicalLineToYRange(editor, startLine); Pair<@NotNull Interval, @Nullable Interval> pair2 = startLine == endLine ? pair1 : EditorUtil.logicalLineToYRange(editor, endLine - 1); int startOffset = pair1.first.intervalStart(); int endOffset = pair2.first.intervalEnd(); return new MarkerRange(startOffset, endOffset); }