public static @NotNull Interval yToLogicalLineRange(@NotNull Editor editor, int y) {
    return ReadAction.compute(() -> {
      int visualLine = editor.yToVisualLine(y);
      if (editor instanceof EditorImpl) {
        VisualLinesIterator iterator = new VisualLinesIterator((EditorImpl)editor, visualLine);
        if (!iterator.atEnd()) {
          return new TextRangeInterval(iterator.getStartLogicalLine(), iterator.getEndLogicalLine());
        }
      }
      int startLogicalLine = editor.visualToLogicalPosition(new VisualPosition(visualLine, 0, false)).line;
      int endLogicalLine = editor.visualToLogicalPosition(new VisualPosition(visualLine, Integer.MAX_VALUE, true)).line;
      return new TextRangeInterval(startLogicalLine, endLogicalLine);
    });
  }
public static @NotNull Interval yToLogicalLineRange(@NotNull Editor editor, int y)