@NotNull
  public static LogicalPosition getCaretPosition(@Nullable Editor editor) {
    return editor != null ? editor.getCaretModel().getLogicalPosition() : new LogicalPosition(0, 0);
  }
@NotNull
  public static LogicalPosition getCaretPosition(@Nullable Editor editor)