The current tagbar_autoclose state will be displayed in the statusline.
Also change the "hide nonpublic" flag to "v" to match the mapping and
properly document the statusline flags.
If someone already has a function that includes "JumpToTag" in its name
then the current method of detecting whether mappings should be
initialized would fail. Use a buffer-local variable instead.
If 'hidden' is not set then BufUnload is called every time a buffer
would get hidden, removing the fileinfo. This causes unnecessary ctags
processing of files.
The current pause functionality simply removes all the autocommands to
stop updating Tagbar. This has the problem that at the moment the
statusline functions immediately restore the commands so pausing doesn't
work, but even if that didn't happen it would stop the statusline
functionality from working which is not desirable. The solution is to
have a reference to the paused file which will get used by the Tagbar
window, but not the statusline functions.
Certain quickfix-commands like vimgrep have to load all searched files
into Vim and will execute the BufReadPost autocmd for all of them. Since
Tagbar doesn't need to generate tags for those files pause processing
while the command is running.
There doesn't seem to be a better way to find out whether vimgrep is
running than to set a temporary variable with the QuickFixCmdPre/Post
autocmds, see also
https://groups.google.com/forum/#!topic/vim_use/sUj5MFGmwD8
Closing Tagbar with :q instead of the provided commands and mappings
would bypass the Vim application window shrinking logic. Install an
autocommand that checks for this situation.
This prevents files being processed twice unnecessarily, once for
FileType and once for BufReadPost. All cases where BufReadPost is called
without FileType should be covered by the checks in AutoUpdate().