private long getNextNanoTime(@NotNull FileEditor editor, boolean isUndo) {
    ClientState clientState = getClientState(editor);
    Collection<DocumentReference> references = getDocRefs(editor);
    if (clientState == null || references == null) {
      return -1L;
    }

    if (isUndo) {
      clientState.myMerger.flushCurrentCommand();
    }

    @NotNull UndoRedoStacksHolder stack = getStackHolder(clientState, isUndo);
    UndoableGroup lastAction = stack.getLastAction(references);
    return lastAction == null ? -1L : lastAction.getGroupStartPerformedTimestamp();
  }
private long getNextNanoTime(@NotNull FileEditor editor, boolean isUndo)