-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local undo state #179
Comments
Hey! I missed this issue.. it's a good question. I think it can be fixed, probably need to handle Undo/Redo shortcuts manually and only apply these actions on the focused editor. I'll take a look. |
I tried to look into this and found some potential answers, but it is unclear to me how this can be applied in the Flok environment. Answers I found: It seems we have to specify const undoManager = new UndoManager(text, {
trackedOrigins: new Set([doc.session.awareness.getLocalState()?.user.name])
}); But then we have to add the origin to the "transaction" made by the User. And for this they give the example to use the doc.on('beforeTransaction', (tr, doc) => {
if (!tr.origin) tr.origin = 'the origin for UndoManager';
}); I tried this but it seems you implemented the y-codemirror.next a bit differently so this Update: Some other user reported that ReactCodemirror's history feature was in the way: https://discuss.yjs.dev/t/how-is-undomanager-being-used/1851/9 I tried disabling by setting On the |
Is it possible to disable the global undo state? Currently it seems that when I press Ctrl + Z it will undo text input including whatever any other connected user has typed. This has caused confusion at times when we start to wonder where our text has gone!
Can undo states just be local to the user?
The text was updated successfully, but these errors were encountered: