-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
If you rename a file that's in a nested directory and you decide to rename one of the nested directories to a name that doesn't exist yet, it will create a new directory instead of renaming the existing directory and your renamed file (even if the file name didn't change) will get located there.
Reproducible steps on Vim 8.1 using the latest master commit as of this issue's date:
- Create a test file in a deeply nested directory:
mkdir -p /tmp/testfern/foo/bar/baz \
&& cd /tmp/testfern \
&& touch foo/bar/baz/hello
-
Open Vim with
vim . -
Open the
hellofile with:e foo/bar/baz/hello -
Toggle and reveal
helloin fern -
Execute
fern-action-moveonhello -
Notice how fern is asking you to rename the
hellofile -
Rename
footofoo2in the destination path and but the leave the file name alone
You will end up with tmp/testfern/foo2/bar/baz/hello and /tmp/testfern/foo/bar/baz will be empty. The file was moved to a new directory instead of the existing foo directory being renamed to foo2.
I'll admit, I'm not 100% on what the expected behavior should be here. Personally I feel like it should probably rename the existing directory to foo2 without creating a new one. It's worth bringing up that if both foo and foo2 directories exist beforehand it will move the file between them as expected.