Inline git blame isn't restored when undoing deleted lines
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
- Put cursor on the line of some version tracked code - notice the inline blame
- Delete line, do not save file
- Undo the deletion
- Notice there is no longer inline blame
Saving the file brings the inline blame back
Environment
Zed: v0.132.0 (Zed Nightly d1928f084e91ccacafaf28eee1ccf5cfef99e6ff) OS: macOS 14.3.1 Memory: 64 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
No response
This might run deeper than inline git blame - not sure - but maybe it has to do with Zed not really being sure if the content is the same as it was before?
Yeah, I think it's unrelated to git blame. If you save the file again after undoing the deletion, the blame information comes back, but the file didn't look "unsaved".
I am on the stable version of Zed(Zed 0.130.7) and tried two things: Step 1) cut a Line (Cmd-X) 2) The first time i did an undo (the blue icon disappeared at the top beside filename), the second time i just pasted it. I never saved the file(turned off autosave also from settings.json) Both times git blame worked after i toggled it on and off. If this was only an issue about zed not being able to identify the file had changed or not. Shouldn't it have worked the first time? Attaching a screen Recording along with this The file size is too big for github (pasting link to discord channel media) https://discord.com/channels/869392257814519848/873292398204170290/1229884007622250556
Yeah, the problem is that we splice all edits into the git blame data. Undos count as edits too. So from the perspective of our data model, the line has been edited, even though the user visible edit has been undone.