rust-lang / rust-lang/rust-mode
Formatting breaks undo, sometimes
Nobody has claimed this yet.
- Dominant language
- Emacs Lisp
- Stars
- 1.3k
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I'm surprised this hasn't been reported before, so maybe this is a misconfiguration... but is it possible that formatting breaks undo? I have rust-format-on-save enabled and quite often, after saving, either undo does nothing or I get a message saying that the end of undo history has been reached, when clearly there were previous edits. I haven't figured out a pattern yet, but this only appears to happen sometimes.
Obviously, undo can't work in the newly formatted buffer (by which I mean, an edit can't be undone while preserving the new format) but it should be possible to undo the formatting itself (and then any previous edits); this is, for example, how prettier-emacs works.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the problem with rust-format-on-save enabled and compare undo behavior before and after saving. The issue provides no file or test entry point; done means formatting can itself be undone and earlier edits remain available afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100