nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 3e217115bc467f1298ef7880fbe7fe74f75d5f8e
parent 5d564fdbcf83701900837a9bf6629d7159c9fd1d
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Wed, 16 Jul 2008 18:37:52 +1200

fix a bug with improper use of bufwinnr function

add a '^' and '$' to the end of the file matching pattern so it cant get
confused by buffer names that happen to be a substring of buffer we are
comparing against

Diffstat:
Mplugin/NERD_tree.vim | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -2308,7 +2308,7 @@ function! s:OpenFileNode(treenode)
     call s:PutCursorInTreeWin()
 
     "if the file is already open in this tab then just stick the cursor in it
-    let winnr = bufwinnr(a:treenode.path.StrForOS(0))
+    let winnr = bufwinnr('^' . a:treenode.path.StrForOS(0) . '$')
     if winnr != -1
         exec winnr . "wincmd w"