private void commandFinished(@NotNull ClientState state, @NlsContexts.Command String commandName, Object groupId) {
    if (state.myCommandLevel == 0) return; // possible if command listener was added within command
    state.myCommandLevel--;
    if (state.myCommandLevel > 0) return;

    if (myProject != null && state.myCurrentMerger.hasActions() && !state.myCurrentMerger.isTransparent() && state.myCurrentMerger.isPhysical() &&
        state.myOriginatorReference != null) {
      addDocumentAsAffected(state.myOriginatorReference);
    }
    state.myOriginatorReference = null;

    state.myCurrentMerger.setAfterState(getCurrentState());
    state.myMerger.commandFinished(commandName, groupId, state.myCurrentMerger);

    disposeCurrentMerger(state);
  }
private void commandFinished(@NotNull ClientState state, @NlsContexts.Command String commandName, Object groupId)