Add a sanity check in case someone closes the preview window.

This commit is contained in:
Steve Losh 2010-10-12 22:35:16 -04:00
parent f2f847d973
commit 9514fd457e

View File

@ -100,10 +100,11 @@ endfunction
function! s:GundoToggle() function! s:GundoToggle()
if expand('%') == "__Gundo__" if expand('%') == "__Gundo__"
" TODO: Add some sanity checks here.
quit quit
if bufwinnr(bufnr('__Gundo_Preview__')) != -1
exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w" exe bufwinnr(bufnr('__Gundo_Preview__')) . "wincmd w"
quit quit
endif
exe bufwinnr(g:gundo_target_n) . "wincmd w" exe bufwinnr(g:gundo_target_n) . "wincmd w"
else else
if expand('%') != "__Gundo_Preview__" if expand('%') != "__Gundo_Preview__"