From 9a75c110b79afebf8446661d4f40a46dded373f3 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Tue, 20 Sep 2016 23:30:18 +1200 Subject: [PATCH] Don't choke when run from netrw, closes #291 --- autoload/tagbar.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index c8f4721..99338f6 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -4030,7 +4030,9 @@ function! s:QuitIfOnlyWindow() abort endif endif - call s:goto_win(prevwinnr, 1) + if prevwinnr != tagbarwinnr + call s:goto_win(prevwinnr, 1) + endif call s:goto_win(curwinnr, 1) endfunction @@ -4039,8 +4041,8 @@ function! s:NextNormalWindow() abort for i in range(1, winnr('$')) let buf = winbufnr(i) - " skip unlisted buffers - if !buflisted(buf) + " skip unlisted buffers, except for netrw + if !buflisted(buf) && getbufvar(buf, '&filetype') != 'netrw' continue endif