tagbar
tagbar copied to clipboard
Failure to load tagbar from nested BufWinEnter autocmd
I was using a nested BufWinEnter autocmd to launch Tagbar on certain file types.
On updating from changeset 3634e7ab4feeab8ad49166e9e716638c20f1637c to the latest, Tagbar stopped opening. Indeed, it would set the filetype incorrectly to Tagbar on the newly opened code file instead of the code file getting the correct auto-detected file type!
I found the first "bad" change using git bisect:
git.exe bisect bad
7c5606668526c999c9a5c72ff1ec23300ae2a60f is the first bad commit
commit 7c5606668526c999c9a5c72ff1ec23300ae2a60f
Author: Martin Vuille <[email protected]>
Date: Sat Sep 24 17:48:52 2016 -0400
Give each tab its own tagbar buffer
:040000 040000 b28ad0aa48797b3dfbfd98eea883f4ede72cc305 409da1cd1a57bfc25feb8506bd03e23dae2d6290 M autoload
Success (2094 ms @ 12/13/2018 10:49:57 PM)
After reading issue #501 I tried deleting the "nested" keyword from my autocmd, and it seems to work now. I'm not sure whether the code needs an update to make this work again, or if the documentation needs an update to remove "nested" from the suggested autocmds.
For reference, here's the offending autocmd:
let g:funclist_cmd_open = 'call tagbar#autoopen()'
" ...
autocmd BufWinEnter *.{h,c{pp,}}{@@/*,} nested
\ if winnr("$") < 2 && !&diff && exists('g:funclist_cmd_open') |
\ exec g:funclist_cmd_open |
\ endif
@fritzophrenic are you still seeing this issue? or were you able to get everything working correctly?