Merge pull request #493 from fievel/master

This commit is contained in:
Caleb Maclennan 2019-10-21 19:37:10 +03:00 committed by GitHub
commit a8e050f448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -303,6 +303,7 @@ function! s:MapKeys() abort
\ ['togglesort', 'ToggleSort()'],
\ ['togglecaseinsensitive', 'ToggleCaseInsensitive()'],
\ ['toggleautoclose', 'ToggleAutoclose()'],
\ ['togglepause', 'TogglePause()'],
\ ['zoomwin', 'ZoomWindow()'],
\ ['close', 'CloseWindow()'],
\ ['help', 'ToggleHelp()'],
@ -1845,6 +1846,7 @@ function! s:PrintHelp() abort
silent put ='\" ' . s:get_map_str('togglesort') . ': Toggle sort'
silent put ='\" ' . s:get_map_str('togglecaseinsensitive') . ': Toggle case insensitive sort option'
silent put ='\" ' . s:get_map_str('toggleautoclose') . ': Toggle autoclose option'
silent put ='\" ' . s:get_map_str('togglepause') . ': Toggle pause'
silent put ='\" ' . s:get_map_str('zoomwin') . ': Zoom window in/out'
silent put ='\" ' . s:get_map_str('close') . ': Close window'
silent put ='\" ' . s:get_map_str('help') . ': Toggle help'
@ -3201,6 +3203,21 @@ function! s:warning(msg) abort
echohl None
endfunction
" s:TogglePause() {{{2
function! s:TogglePause() abort
let s:paused = !s:paused
if s:paused
call tagbar#state#set_paused()
else
let fileinfo = tagbar#state#get_current_file(0)
let taginfo = fileinfo.getTags()[0]
call s:GotoFileWindow(taginfo.fileinfo)
call s:AutoUpdate(taginfo.fileinfo.fpath, 1)
endif
endfunction
" TagbarBalloonExpr() {{{2
function! TagbarBalloonExpr() abort
let taginfo = s:GetTagInfo(v:beval_lnum, 1)

View File

@ -369,6 +369,8 @@ s Toggle sort order between name and file order.
Map option: tagbar_map_togglesort
c Toggle the |g:tagbar_autoclose| option.
Map option: tagbar_map_toggleautoclose
t Toggle the pause (like :TagbarTogglePause)
Map option: tagbar_map_togglepause
x Toggle zooming the window.
Map option: tagbar_map_zoomwin
q Close the Tagbar window.

View File

@ -116,6 +116,7 @@ function! s:setup_keymaps() abort
\ ['togglesort', 's'],
\ ['togglecaseinsensitive', 'i'],
\ ['toggleautoclose', 'c'],
\ ['togglepause', 't'],
\ ['zoomwin', 'x'],
\ ['close', 'q'],
\ ['help', ['<F1>', '?']],