Skip to content

use single undoManager for multiple types #156

@calibr

Description

@calibr

I'm glad to see new implentation of UndoManager, it is much cleaner!

For my task I need something like this:

new UndoManager([ type1, type2 ])

to have the same stack for both type1 and type2, so their changes can be captured together with the same StackItems. I tried to set separate observers for the types, but the problem is when I do undo and the undoying StackItem has changes in both types it creates two StackItems for the redo stack(UndoManager do not capture items together for undo/redo). I also tried using the afterTransaction event to listen to changes instead of using observeDeep, but result was the same, because afterTransaction also was being called twice for undo.

@dmonad do you have any ideas on how to implement this?

Huly®: YJS-125

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions