diff --git a/plugin/tagbar.vim b/plugin/tagbar.vim index 11abe80..8bd7698 100644 --- a/plugin/tagbar.vim +++ b/plugin/tagbar.vim @@ -400,6 +400,8 @@ function! s:OpenWindow() setlocal foldcolumn=1 setlocal foldtext=v:folddashes.getline(v:foldstart) + setlocal statusline=%!TagbarGenerateStatusline() + " Variable for saving the current file for functions that are called from " the tagbar window let s:current_file = '' @@ -1073,7 +1075,7 @@ endfunction " s:PrintHelp() {{{1 function! s:PrintHelp() if s:short_help - call append(0, '" Press F1 for help') + call append(0, '" Press for help') else call append(0, '" : Jump to tag definition') call append(1, '" : Display tag prototype') @@ -1311,6 +1313,20 @@ function! s:ToggleHelp() execute 1 endfunction +" TagbarGenerateStatusline() {{{1 +function! TagbarGenerateStatusline() + if g:tagbar_sort + let text = '[Name]' + else + let text = '[Order]' + endif + + let filename = fnamemodify(s:current_file, ':t') + let text .= ' ' . filename + + return text +endfunction + " s:PrintWarningMsg() {{{1 function! s:PrintWarningMsg(msg) echohl WarningMsg