Closed ankon closed 2 years ago
I'm not sure if this will yield the intended result. It would probably be best to use the Yjs undo-manager and remove the history plugin.
However, I'll add this addition because it's a definite improvement.
Thanks a lot!
For us this actually works quite well, and the yjs undo manager was problematic for two reasons:
Having the option here definitely helps!
Changes coming through Yjs are not changes from the local user, but rather they represent changes in other places in the system. Such changes do not need to be tracked and made undo-able. This plugin also triggers prosemirror changes when rendering snapshots and when forcing re-renders, which do a full document replace step.
By marking these with the
"addToHistory"
meta the prosemirror-history plugin will be able to ignore these changes for the purposes of providing undo/redo functionality on the editor model level, without affecting a Yjs document level undo/redo.See also https://discuss.yjs.dev/t/avoiding-y-prosemirror-undo/985