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
Throttle save participants when low auto save delay is configured to allow for undo #102542
Comments
I have auto save on and its delay is
Then I got stuck. Workaround for me is slowing down the auto save but it's still bad. |
I can reproduce but I cannot see how to fix this easily given autosave is at 100ms? Here is what seems to happen:
You could only go back if you managed to undo faster than auto save kicking in, right? One possible solution maybe on the editor would be to merge the undo stack into one, e.g. the change the user did and the result of the save participants become one operation? Though that might cause a lot of issues when people want to undo the result of a formatter... |
Yeah, we code in place to make sure that automagically made edits are in one undo stack which is separate from manual edits. Wouldn't be a simple fix to put a lower-cap on the auto save timeout? For instance it doesn't get faster than 700ms or so? It's like the font size which doesn't go below 6 |
Yeah we can put a cap as last resort, but then again maybe people really rely on save kicking in instantly. Two more ideas: Cap auto save when undoing Do not run save participants when undoing |
Pushed the following fix:
This should give a user a chance to trigger the undo command repeatedly, provided the user can do that multiple times below |
@bpasero thanks for the quick turnaround! I set the delay to a low number as I wish to see errors/warnings from build task as soon as possible, the solution is reasonable as whenever I found cmd+z not working, I try to cmd+z a couple of times more so the |
Steps to Reproduce:
files.insertFinalNewline
a
Ran into this issue twice today when I was typing really fast and replaced several lines with random characters by mistake and then lost all my work.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: