Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing 'R' the file list fails when a new file name matches an existing one with different case. #1329

Closed
8 tasks
ghost opened this issue Sep 22, 2022 · 8 comments · Fixed by #1382
Closed
8 tasks
Labels

Comments

@ghost
Copy link

ghost commented Sep 22, 2022

Self-Diagnosis - CHECKED - NOT FOUND

Environment

"Empty vimrc file

Maybe related to Issue #1241

Steps to Reproduce the Issue

  1. Create files 'test2.txt' and 'TEST.txt'
  2. Start VIM and NerdTREE
  3. Rename 'test2.txt' to 'test.txt' from outside vim
  4. Press 'R' in Nerdtree to refresh the list of files.

Current Behavior (Include screenshots where appropriate.)

Two files with the same name 'TEST.txt' appear. Clicking any of the two opens 'TEST.txt'.
The file test.txt does not appear and cannot be opened from NerdTree

Expected Result

Both files 'TEST.txt' and 'test.txt' show up in the list of files.

@ghost ghost added the bug label Sep 22, 2022
@igbanam
Copy link

igbanam commented Nov 13, 2022

This may be an OS-specific problem. I am on Mac OS Ventura, Vim 9, and this seems to work perfectly.

TEST.txt and Test.txt are considered the same file.

Screen.Recording.2022-11-13.at.18.56.39.mov

@ghost
Copy link
Author

ghost commented Nov 14, 2022

This may be an OS-specific problem. I am on Mac OS Ventura, Vim 9, and this seems to work perfectly.

TEST.txt and Test.txt are considered the same file.
Screen.Recording.2022-11-13.at.18.56.39.mov

NERDTree seems to be unable to recognize filename case, which is a different problem. Please try renaming the file outside of vim. I am updating the issue to reflect this point. Thank you.

@igbanam
Copy link

igbanam commented Nov 14, 2022

I still think this problem may be outside NERDTree; if at all.

Screenshot 2022-11-14 at 09 43 59

@ghost
Copy link
Author

ghost commented Nov 14, 2022

I still think this problem may be outside NERDTree; if at all.

What you have done in this reply is try to match against the git filename matcher. Git is designed to be portable, such that the git filename matcher will preserve case but match filenames whose only difference is case. Therefore, git will show test.txt and TEST.txt as the same file. Because of limitation in Microsoft filesystems.
However the issue I opened has nothing to do with git.

@igbanam
Copy link

igbanam commented Nov 14, 2022

It has nothing to do with Git 🙂

tmux_new_-s_everything-everywhere

@igbanam
Copy link

igbanam commented Nov 14, 2022

Now we know it's a filesystem issue. Maybe NERDTree could look into handling Microsoft filesystems better? I don't know a good solution to this. But generally files should be unique on their non-case-sensitive names. Hopefully someone with a Windows machine can look into this. I may not be of much help since I don't have the right environment to reproduce this.

@ghost
Copy link
Author

ghost commented Nov 14, 2022

Check that 'mv' is not an alias of 'git mv' in your shell. Unix systems(OSX, Linux, BSD, etc but not Windows) have case sensitive filenames.

@ghost
Copy link
Author

ghost commented Nov 14, 2022

Also, I see your machine is an Apple. I understand that some filesystems that OSX uses are not case-sensitive. So try to reproduce the problem in a Linux machine, which follows closer the POSIX standard in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant