From c59ac8fba14bfd6d0ba3efe293f5d4a7f5507656 Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Mon, 5 Nov 2012 01:21:53 +0800 Subject: [PATCH] Make NERDTreeFind use an existing NERDTree window --- plugin/NERD_tree.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 3e7c1bb..1a37c03 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -3019,7 +3019,13 @@ function! s:findAndRevealPath() endif else if !p.isUnder(s:TreeFileNode.GetRootForTab().path) - call s:initNerdTree(p.getParent().str()) + if !s:isTreeOpen() + call s:createTreeWin() + else + call s:putCursorInTreeWin() + endif + let b:NERDTreeShowHidden = g:NERDTreeShowHidden + call s:chRoot(s:TreeDirNode.New(p.getParent())) else if !s:isTreeOpen() call s:toggle("")