private static void runForCaret(@NotNull Caret caret, Editor editor, Runnable runnable) {
    editor.getCaretModel().runForEachCaret(candidate -> {
      if (candidate != caret) return;
      runnable.run();
    });
  }
private static void runForCaret(@NotNull Caret caret, Editor editor, Runnable runnable)