nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 9bedadd062be9d5c8b3e43686b36ac1842085048
parent 12dea6ccb2381a2b6b8ae0bf17b4078699bbfec3
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date:   Tue, 18 Jun 2019 10:27:00 -0400

Refresh a dir_node if the file wasn't found in it, and look once more. (#1005)


Diffstat:
Mlib/nerdtree/tree_dir_node.vim | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim
@@ -620,6 +620,11 @@ function! s:TreeDirNode.reveal(path, ...)
 
     if self.path.equals(a:path.getParent())
         let n = self.findNode(a:path)
+        " We may be looking for a newly-saved file that isn't in the tree yet.
+        if n == {}
+            call self.refresh()
+            let n = self.findNode(a:path)
+        endif
         if has_key(opts, "open")
             call n.open()
         endif