corpus icon indicating copy to clipboard operation
corpus copied to clipboard

Handle file renames better at Git layer

Open wincent opened this issue 4 years ago • 0 comments

At the moment if you rename a note with, say, :Rename x.md, the file with the new name will correctly be added to Git, but the old one will just be marked as deleted from the index.

The commit is being invoked here in response to a BufWritePost autocmd. To handle renames (or straight-up deletions) we'd probably need to hook in to a different autocmd (this may produce two commits instead of one atomic commit, but that would be better than not recording the deletion in Git). Not sure if BufDelete gets called in this case, or something else — will have to look into it.

wincent avatar Nov 25 '21 16:11 wincent