Is there a way to customize the undo history list?

I inserted a piece of text into the code block in the following way:

const transaction = editorView.state.update({
  changes: {
    insert: "C"

but I don’t want to add this operation to the undo history list. When using “Mod-z” for an undo operation, I want to skip this text insertion and directly return to an earlier historical state. What should I do?

For example: Initially, there was text ‘A’ in my code block. Then I entered ‘B,’ and after that, I used the code editorView.dispatch(transaction) to insert ‘C.’ At this point, the text inside the code block is ‘ABC.’ Now, when I press Mod-z, I want the text in the code block to be ‘A’ instead of ‘AB’ because I don’t want to include the ‘C’ insertion operation in the undo history list.

There’s an annotation you can add to transactions to get this effect.