From 4ac443fe3e4d94685e2bd18e61568f611aa641e1 Mon Sep 17 00:00:00 2001 From: Isharaka Gunasinghe Date: Wed, 13 May 2020 20:12:03 +1000 Subject: [PATCH] adds a global option to allow keeping tagbar local to the window containing the buffer --- autoload/tagbar.vim | 9 +++++++++ 1 file changed, 9 insertions(+) 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