1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Add g:tagbar_show_tag_count option (#685)

* Add g:tagbar_show_tag_count option

Closes #290

This option will show the tag kind count next to the kind label in the
tagbar window.

* Address review comments
This commit is contained in:
raven42
2020-10-27 09:18:30 -05:00
committed by GitHub
parent 0d1c6442d9
commit 469c4b3188
3 changed files with 19 additions and 1 deletions

View File

@@ -1967,7 +1967,12 @@ function! s:PrintKinds(typeinfo, fileinfo) abort
endif
let padding = g:tagbar_show_visibility ? ' ' : ''
call add(output, foldmarker . padding . kind.long)
if g:tagbar_show_tag_count
let tag_count = ' (' . len(curtags) . ')'
call add(output, foldmarker . padding . kind.long . tag_count)
else
call add(output, foldmarker . padding . kind.long)
endif
let curline = len(output) + offset
let kindtag.tline = curline

View File

@@ -718,6 +718,18 @@ window. It can be set to the following values:
Example:
>
let g:tagbar_show_tag_linenumbers = 1
<
*g:tagbar_show_tag_count*
g:tagbar_show_tag_count~
Default: 0
This option allows showing the tag count next to the tag kind in the tagbar
window. This will show up like this >
> functions (<tag-count>)
<
Example:
>
let g:tagbar_show_tag_count = 1
<
*g:tagbar_hide_nonpublic*
g:tagbar_hide_nonpublic~

View File

@@ -103,6 +103,7 @@ function! s:setup_options() abort
\ ['show_balloon', 1],
\ ['show_visibility', 1],
\ ['show_linenumbers', 0],
\ ['show_tag_count', 0],
\ ['show_tag_linenumbers', 0],
\ ['singleclick', 0],
\ ['sort', 1],