docs: function histTransaction(history, state, dispatch, redo) {
    let preserveItems = mustPreserveItems(state), histOptions = historyKey.get(state).spec.config
    let pop = (redo ? history.undone : history.done).popEvent(state, preserveItems)
    if (!pop) return
  
    let selection = pop.selection.resolve(pop.transform.doc)
    let added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),
                                                                    histOptions, preserveItems)
  
    let newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0)
    dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {redo, historyState: newHist}).scrollIntoView())
  }