discardHistoryAfterIndex method

void discardHistoryAfterIndex()

After an undo, call this to discard all of the transactions after this point in the history, as indicated by the #historyIndex. This method is called when a transaction occurs after some number of undo's without the same number of redo's, in order to remove all of the transactions that happened after the current history point, and then adding the new transaction.

This modifies the #history but leaves #historyIndex unchanged. After a successful discard, #canRedo will return false.

This method does nothing if #canRedo returns false, or if an undo or a redo is ongoing. @since 2.4

Implementation

void discardHistoryAfterIndex() {
  _i4.callMethod(
    this,
    'discardHistoryAfterIndex',
    [],
  );
}