Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential fix for #772 - InitWindow issue #773

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions autoload/tagbar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ function! s:CreateAutocommands() abort

autocmd WinEnter * if bufwinnr(s:TagbarBufName()) == -1 |
\ call s:ShrinkIfExpanded() |
\ else |
\ call s:InitWindow(g:tagbar_autoclose) |
\ endif

autocmd BufWritePost *
Expand Down Expand Up @@ -968,6 +970,10 @@ endfunction
function! s:InitWindow(autoclose) abort
call tagbar#debug#log('InitWindow called with autoclose: ' . a:autoclose)

if exists('w:tagbar_win_init')
call tagbar#debug#log('InitWindow - already initialized this window')
return
endif
" Buffer-local options

setlocal filetype=tagbar
Expand Down Expand Up @@ -1051,6 +1057,7 @@ function! s:InitWindow(autoclose) abort
let s:expand_bufnr = bufnr('%')
endif

let w:tagbar_win_init = 1
call tagbar#debug#log('InitWindow finished')
endfunction

Expand Down Expand Up @@ -1109,6 +1116,7 @@ function! s:CloseWindow() abort
call tagbar#StopAutoUpdate()
endif

unlet w:tagbar_win_init
call tagbar#debug#log('CloseWindow finished')
endfunction

Expand Down