Commit to history after executing a command from the palette - #5294
Merged
the-mikedavis merged 2 commits intoJan 16, 2023
Merged
Conversation
Member
|
I think the ideal fix for this has some overlap with #4013, #4244 and #4709: we should be able to queue up command(s) for the compositor to execute in the same way that we can queue up key events. I'm not sure how that should look yet though. This should fix most of the behavior with the command palette though so we might want to merge this as-is. |
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
the-mikedavis
approved these changes
Jan 16, 2023
the-mikedavis
left a comment
Member
There was a problem hiding this comment.
I left some notes on an idea for a long-term fix: #4709 (comment) (note: that would be a very large change that should probably be split across multiple PRs).
It's pretty easy to trigger panics without this fix though so I'll pull this in as-is 👍
gibbz00
pushed a commit
to gibbz00/helix
that referenced
this pull request
Jan 17, 2023
kirawi
pushed a commit
to kirawi/helix
that referenced
this pull request
Jan 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5261
While this does fix the underlying issue of that bug, which was that appending to history only happened in editor.rs:1424 which meant that undo-ing after executing a command from the palette would call
undobefore the change was committed, it does not address the bigger issue - that it's way too easy to mutate a document and have document and history desync.I'm opening this PR not necessairly to have this fix merged (although we could do it to fix the issue temporarily) but to document and highlight the root cause and possibly discuss a long-term fix, which I'd gladly take on implementing.
Discussion from the matrix channel about this issue: