From 9bedadd062be9d5c8b3e43686b36ac1842085048 Mon Sep 17 00:00:00 2001 From: Phil Runninger Date: Tue, 18 Jun 2019 10:27:00 -0400 Subject: [PATCH] Refresh a dir_node if the file wasn't found in it, and look once more. (#1005) --- lib/nerdtree/tree_dir_node.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nerdtree/tree_dir_node.vim b/lib/nerdtree/tree_dir_node.vim index a834e7c..aa9dea6 100644 --- 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