yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
328 stars 115 forks source link

Inspect meta of `appendedTransaction` for possible `addToHistory:false` #142

Open romansp opened 11 months ago

romansp commented 11 months ago

Resolves #141.

Using the same approach as in native prosemirror-history, added inspection of appendedTransaction meta for possible addToHistory: false to prevent root transaction from appearing on the undo/redo stack.

Added a test case that covers expected behavior.

BrianHung commented 6 months ago

Great fix for developers trying to chain multiple commands together but only have one undo / redo for all using the appendedTransaction meta.