-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix duplicated slash in s:Path.isUnder() (on windows OS) (#1122)
* * fix duplicated slash in s:Path.isUnder() (on windows OS, for root directory on drive Path.str() return path with [back]slash) * * Rewrite NERDTreePath.isUnder() and NERDTreePath.isAncestor() for direct comparison of paths without transformations * Remove trailing slash, so we don't end up with two on root folder. The str() function returns "C:\" on the root folder and "C:\temp" on non-root folders, one with and one without a trailing backslash. This inconsistency needs to be handled so the stridx() function will work correctly. * Make sure the change also works in a non-windows file system. This commit handles an edge case that can be triggered with these commands: :cd /home/me :e /foobar.txt (an existing file) :NERDTreeFind What happened was the root directory name '/' was being Resolved(), and the trailing (and only) slash was being removed. The NERDTree was then created in the current working directory, instead of the root directory. :NERDTreeFind then wasn't able to find foobar.txt, and printed an error. * Remove degugging statements. * * ambiguity issue fix Co-authored-by: Phil Runninger <philrunninger@gmail.com>
- Loading branch information
1 parent
4cc6097
commit e2670f0
Showing
3 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters