From 15eddce14fa805a25d73735668af4c3ea2169c7a Mon Sep 17 00:00:00 2001 From: kianryan Date: Thu, 1 Nov 2012 14:36:45 +0000 Subject: [PATCH] Updates to TagbarTogglePause Changes requested by majutsushi. Changed function to :TagbarTogglePause Added documentation for function, including usage and defintion. Changed autocommands_enable to autocommands_enabled. --- autoload/tagbar.vim | 8 ++++---- doc/tagbar.txt | 11 +++++++++++ plugin/tagbar.vim | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 612e663..87bf07e 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -45,7 +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 +let s:autocommands_enabled = 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 @@ -972,15 +972,15 @@ function! s:CreateAutocommands() abort augroup END let s:autocommands_done = 1 - let s:autocommands_enable = 1 + let s:autocommands_enabled = 1 endfunction " s:PauseAutocommands() {{{2 " Toggle autocommands function! s:PauseAutocommands() abort - if s:autocommands_enable == 1 + if s:autocommands_enabled == 1 autocmd! TagbarAutoCmds - let s:autocommands_enable = 0 + let s:autocommands_enabled = 0 else call s:CreateAutocommands() call s:AutoUpdate(fnamemodify(expand('%'), ':p'), 0) diff --git a/doc/tagbar.txt b/doc/tagbar.txt index ed564f8..b009a14 100644 --- a/doc/tagbar.txt +++ b/doc/tagbar.txt @@ -194,6 +194,13 @@ You can also use |:TagbarOpenAutoClose| to open the Tagbar window, jump to it and have it close automatically on tag selection regardless of the |g:tagbar_autoclose| setting. +Pausing the Tagbar window~ +Use :TagbarTogglePause to toggle freezing the Tagbar window on its currently +displayed file. Freezing the window stops the Tagbar from changing when +switching to a different source file. All Tagbar functionality continues +to work as expected. Unfreezing the window will cause it to load the current +source file. + Jumping to tags~ When you're inside the Tagbar window you can jump to the definition of a tag by moving the cursor to a tag and pressing or double-clicking on it @@ -260,6 +267,10 @@ COMMANDS *tagbar-commands* Open the Tagbar window, jump to it and close it on tag selection. This is an alias for ":TagbarOpen fjc". +:TagbarTogglePause *:TagbarTogglePause* + Freezes/Unfreezes the Tagbar window. Stops the contents of the window + from changing when a different source file is selected. + :TagbarSetFoldlevel[!] {number} *:TagbarSetFoldlevel* Set the foldlevel of the tags of the current file to {number}. The foldlevel of tags in other files remains unaffected. Works in the same way diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 7b815ee..cdb4cac 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -115,7 +115,7 @@ command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current t command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig() command! -nargs=? TagbarDebug call tagbar#StartDebug() command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug() -command! -nargs=0 TagbarPause call tagbar#PauseAutocommands() +command! -nargs=0 TagbarTogglePause call tagbar#PauseAutocommands() " Modeline {{{1 " vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1