private void clearUndoRedoQueue(@NotNull ClientState state, @NotNull DocumentReference docRef) {
    state.myMerger.flushCurrentCommand();
    disposeCurrentMerger(state);

    Set<DocumentReference> set = Collections.singleton(docRef);
    state.myUndoStacksHolder.clearStacks(false, set);
    state.myRedoStacksHolder.clearStacks(false, set);
    mySharedUndoStacksHolder.trimStacks(set);
    mySharedRedoStacksHolder.trimStacks(set);
  }
private void clearUndoRedoQueue(@NotNull ClientState state, @NotNull DocumentReference docRef)