Closed wroyca closed 8 months ago
Thanks for the issue!
I can indeed confirm. The reason this happens is because of how 'mini.files' tracks which operation need to be done. Here is what is going on:
/1/hello.c
and /2/hello.h
. Here 1 and 2 are unique path identifiers which are stored for each session./1/main.c
and /2/hello.h
. 'mini.files' sees that the file 1
doesn't match what it has stored and deduces that file should be renamed. And successfully renames. Lines after that are /2/hello.h
and /3/main.c
as 'main.c' is a different path on disk.3
was present and now is missing thus deciding it needs to be deleted. I think it should also suggest creating file 2
in this situation, but it does not.I'll see what is the best approach in this situation.
Thanks again for opening the issue! This should be fixed on latest main
.
Thanks again for opening the issue! This should be fixed on latest
main
.
I confirm, thank for the quick fix!
Contributing guidelines
Module(s)
files
Description
After renaming a file and confirming the change, attempting to undo and then reconfirming will result in the file being deleted. This has led to many issues in large-scale codebase refactoring, among others.
Neovim version
NVIM v0.10.0-dev+1974-g714b07519
Steps to reproduce
Expected behavior
Undoing a file rename should not result in file deletion; rather, main.c should revert to being hello.c.
Actual behavior
Screencast from 2024-01-15 11-54-09.webm