mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-18 03:50:26 +01:00
Pause autocmd functionality with :TagbarPause
tagbar#PauseAutocommands :TagbarPause :TagbarPause pauses autocmds, effectively freezing Tagbar on the last file. Useful for keeping a tag reference for a file open whilst working in a different file.
This commit is contained in:
@@ -45,6 +45,7 @@ let s:icon_open = g:tagbar_iconchars[1]
|
||||
|
||||
let s:type_init_done = 0
|
||||
let s:autocommands_done = 0
|
||||
let s:autocommands_enable = 0
|
||||
" 0: not checked yet; 1: checked and found; 2: checked and not found
|
||||
let s:checked_ctags = 0
|
||||
let s:checked_ctags_types = 0
|
||||
@@ -971,6 +972,19 @@ function! s:CreateAutocommands() abort
|
||||
augroup END
|
||||
|
||||
let s:autocommands_done = 1
|
||||
let s:autocommands_enable = 1
|
||||
endfunction
|
||||
|
||||
" s:PauseAutocommands() {{{2
|
||||
" Toggle autocommands
|
||||
function! s:PauseAutocommands() abort
|
||||
if s:autocommands_enable == 1
|
||||
autocmd! TagbarAutoCmds
|
||||
let s:autocommands_enable = 0
|
||||
else
|
||||
call s:CreateAutocommands()
|
||||
call s:AutoUpdate(fnamemodify(expand('%'), ':p'), 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" s:CheckForExCtags() {{{2
|
||||
@@ -3456,6 +3470,11 @@ endfunction
|
||||
function! tagbar#RestoreSession() abort
|
||||
call s:RestoreSession()
|
||||
endfunction
|
||||
|
||||
function! tagbar#PauseAutocommands() abort
|
||||
call s:PauseAutocommands()
|
||||
endfunction
|
||||
|
||||
" }}}2
|
||||
|
||||
" tagbar#getusertypes() {{{2
|
||||
|
||||
Reference in New Issue
Block a user