public static int logicalToVisualLine(@NotNull Editor editor, int logicalLine) {
    return ReadAction.compute(() -> {
      LogicalPosition logicalPosition = new LogicalPosition(logicalLine, 0);
      VisualPosition visualPosition = editor.logicalToVisualPosition(logicalPosition);
      return visualPosition.line;
    });
  }
public static int logicalToVisualLine(@NotNull Editor editor, int logicalLine)