CodeMirror 6 - Is there a way to know, if the doc was changed by the `view.dispatch(transaction)`.

Previously in CodeMirror 5, the change event had an origin attribute which showed on how the doc was changed

from: Pos,
to: Pos,
text: Array[1],
removed: Array[1],
origin:: "+input"
editor.on('change', (instance, changes) => {

How to get the same in CodeMirror 6 ? when changing the doc using dispatch method, how to know if it was changed by the user or by the dispatch method ? @marijn

You may be looking for Transaction.userEvent.

1 Like

Thanks A Lot! :smile: