From e212be6a12250d66a118985f316c1dcf93f00681 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 5 Nov 2016 19:20:22 +1300 Subject: [PATCH] Resize window after opening, ref #246 This prevents an incorrect window size from being used in some edge cases. --- autoload/tagbar.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 9e67f74..78b4a1a 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1884,13 +1884,16 @@ function! s:OpenWindow(flags) abort let s:window_opening = 1 if g:tagbar_vertical == 0 - let openpos = g:tagbar_left ? 'topleft vertical ' : 'botright vertical ' + let mode = 'vertical ' + let openpos = g:tagbar_left ? 'topleft ' : 'botright ' let width = g:tagbar_width else + let mode = '' let openpos = g:tagbar_left ? 'leftabove ' : 'rightbelow ' let width = g:tagbar_vertical endif - exe 'silent keepalt ' . openpos . width . 'split ' . s:TagbarBufName() + exe 'silent keepalt ' . openpos . mode . width . 'split ' . s:TagbarBufName() + exe 'silent ' . mode . 'resize ' . width unlet s:window_opening call s:InitWindow(autoclose)