boolean isUndoOrRedoAvailable(@Nullable FileEditor editor, boolean undo) {
    ApplicationManager.getApplication().assertWriteIntentLockAcquired();

    Collection<DocumentReference> refs = getDocRefs(editor);
    return refs != null && isUndoOrRedoAvailable(getClientState(editor), refs, undo);
  }
boolean isUndoOrRedoAvailable(@Nullable FileEditor editor, boolean undo)