public static void restoreSelection(@NotNull Editor editor, @NotNull TextRange selectedRange) {
    if (handleSelectionIntersection(editor, selectedRange)) {
      return;
    }
    editor.getSelectionModel().setSelection(selectedRange.getStartOffset(), selectedRange.getEndOffset());
  }
public static void restoreSelection(@NotNull Editor editor, @NotNull TextRange selectedRange)