diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index cc23e79..f04771c 100644 --- 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"