-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Case Sensitive Move Operation #1375
Conversation
I've gone through some iterations and tried to streamline our approach to potentially fix other similar issues using it. |
I tested both |
@kevinkowalew Thanks for testing and reporting, that's super helpful to move things forward! |
Thanks to @kevinkowalew we have confirmation that these changes work on the macOS, I would've waited for @dangibson to give some feedback on this PR because he's also working on a similar issue in #1346 but since these changes are pretty essential and minor implementation details can always be changed in the subsequent patches I'm going to move forward with merging it into the upstream. |
Description of Changes
Closes #1373 and potentially many unresolved issues on the subject of case insensitivity.
In this commit, I've introduced a new option called
NERDTreeCaseInsensitiveFS
which could also be used in the future to resolve similar issues in other places.Until now the Move Operation used to check if the destination path already exists or not, On case-insensitive file systems this check fails if the user wants to move the file to a location with a different casing (for example moving/renaming
foo.bar
toFOO.BAR
) as both paths point to the same file. With this new option, we can have an extra check to see whether or not the new destination is the same path in a different casing, and if that's the case we can ignore this false positive check.With this new change came a wrong artifact, After the rename operation we check if an open buffer to this path exists or not.
Then we will point every window to that buffer to a new buffer for the new file path, vim doesn't acknowledge the new file path if it already has one open for the old casing file, I've used a temp buffer to compensate for this issue. Now we first redirect every window to a temp buffer, close the old buffer, and point windows looking at the temp buffer to this newly created one.
This part is written very clearly and has a lot of comments explaining each step of the process in the code itself.
New Version Info
@alerque Sadly we skipped a few commits versioning, I would like to make a PR adding versions / CHANGELOG to the old merged PRs.
We can either block this PR until we fix the change log, or go ahead and merge it and give it a change log in the fix PR.
Author's Instructions
MAJOR.MINOR.PATCH
version number. Increment the:MAJOR
version when you make incompatible API changesMINOR
version when you add functionality in a backwards-compatible mannerPATCH
version when you make backwards-compatible bug fixesCollaborator's Instructions