nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 52151fb30741dfd3665d3e4e5493c6cc822992fc
parent f98078d3ae6d356fcc58a4fc8840eb55b1ea522e
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Wed, 24 Oct 2018 22:13:42 -0400

Call Resolve on the file's path when calling :NERDTreeFind. (#896)

When :NERDTreeFind creates a tree, it resolves the file's path, and
makes that its root. See :h resolve() for more info; it basically
tracks down links to their ultimate source. Then :NERDTreeFind
tries to find the file under that root, so it can be revealed. The
problem is that it compares the file's unresolved path against the
resolved path in the root. Here is the scenario:

/tmp/ is a link to /private/tmp/
:e /tmp/foo will open the file as expected
:NERDTreeFind will first create a tree with a root of /private/tmp/
Then it tries to find /tmp/foo, but it can't, because the path
names don't match.

This commit resolves /tmp/foo to the actual location of
/private/tmp/foo; thus, it is able to find the file in the tree.
Diffstat:
Mautoload/nerdtree/ui_glue.vim | 1+
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/autoload/nerdtree/ui_glue.vim b/autoload/nerdtree/ui_glue.vim
@@ -255,6 +255,7 @@ function! s:findAndRevealPath(pathStr)
     endif
 
     try
+        let l:pathStr = g:NERDTreePath.Resolve(l:pathStr)
         let l:pathObj = g:NERDTreePath.New(l:pathStr)
     catch /^NERDTree.InvalidArgumentsError/
         call nerdtree#echoWarning('invalid path')