diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index d210b8c2..2762a778 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -888,10 +888,19 @@ function! s:OpenWindow(flags) abort let openpos = g:tagbar_left ? 'leftabove ' : 'rightbelow ' let width = g:tagbar_vertical endif + + let l:splitright = &splitright + if g:tagbar_window_local == 1 + let openpos = '' + let &splitright = g:tagbar_left ? 0 : 1 + endif + exe 'silent keepalt ' . openpos . mode . width . 'split ' . s:TagbarBufName() exe 'silent ' . mode . 'resize ' . width unlet s:window_opening + let &splitright = l:splitright + call s:InitWindow(autoclose) " If the current file exists, but is empty, it means that it had a