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
This commit is contained in:
Martin Grenfell 2008-07-16 18:37:52 +12:00
parent 5d564fdbcf
commit 3e217115bc

View File

@ -2308,7 +2308,7 @@ function! s:OpenFileNode(treenode)
call s:PutCursorInTreeWin() call s:PutCursorInTreeWin()
"if the file is already open in this tab then just stick the cursor in it "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 if winnr != -1
exec winnr . "wincmd w" exec winnr . "wincmd w"