Skip to content
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

Extra undo seems to delete redo history #5

Open
nico-abram opened this issue May 7, 2021 · 1 comment
Open

Extra undo seems to delete redo history #5

nico-abram opened this issue May 7, 2021 · 1 comment

Comments

@nico-abram
Copy link

In the web demo: https://regular.express/

Typing 1 letter and then doing undo-redo works. But with an additional undo after we have nothing to undo, it seems to delete the redo stack, so undo-undo-redo does not redo the letter

This happened on firefox nightly, did not test other browsers but I imagine it reproduces

@nico-abram
Copy link
Author

I digged a bit, findings:

The redo stack seems to be getting cleared here:

clear(&redoStack);

I think:

  1. there is a weird undo at the bottom of the undo stack that changes CursorIndex (to 5 which seems out of bounds, I'm talking about the default Hello string in the demo)
  2. after that is undone, something sets it back to 4 before undo_commit
  3. we reach undo_commit() and the undo lib thinks there was an input to change the 5 to 4, so it clears the redo stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant