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

shane: compact tag line# should be good enough if user set it (#687)

This commit is contained in:
Shane-XB-Qian
2020-10-28 23:17:50 +08:00
committed by GitHub
parent aa8c592201
commit 8efec2509b
4 changed files with 7 additions and 7 deletions

View File

@@ -2202,7 +2202,7 @@ function! s:HighlightTag(openfolds, ...) abort
" If printing the line number of the tag to the left, and the tag is
" visible (I.E. parent isn't folded)
if g:tagbar_show_tag_linenumbers == 2 && tagline == tag.tline
let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\[line [0-9]*\] \?\zs[^( ]\+\ze/'
let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\[[0-9]\+\] \?\zs[^( ]\+\ze/'
else
let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\?\zs[^( ]\+\ze/'
endif

View File

@@ -37,9 +37,9 @@ function! s:strfmt() abort dict
let prefix = self._getPrefix()
if g:tagbar_show_tag_linenumbers == 1
let suffix .= ' [line ' . self.fields.line . ']'
let suffix .= ' [' . self.fields.line . ']'
elseif g:tagbar_show_tag_linenumbers == 2
let prefix .= '[line ' . self.fields.line . '] '
let prefix .= '[' . self.fields.line . '] '
endif
return prefix . self.name . suffix

View File

@@ -23,9 +23,9 @@ function! s:strfmt() abort dict
let prefix = self._getPrefix()
if g:tagbar_show_tag_linenumbers == 1
let suffix .= ' [line ' . self.fields.line . ']'
let suffix .= ' [' . self.fields.line . ']'
elseif g:tagbar_show_tag_linenumbers == 2
let prefix .= '[line ' . self.fields.line . '] '
let prefix .= '[' . self.fields.line . '] '
endif
return prefix . self.name . '*' . suffix

View File

@@ -718,10 +718,10 @@ This option allows printing the tag line number next to the tag in the tagbar
window. It can be set to the following values:
0 - The line number will not be printed
1 - The line number will be printed to the right of the tag >
Example: function1(int i) [line 42]
Example: function1(int i) [123]
<
2 - The line number will be printed to the left of the tag >
Example: [line 42] function1(int i)
Example: [123] function1(int i)
<
Example:
>