1
0
mirror of https://github.com/gryf/tagbar.git synced 2026-02-13 12:25:46 +01:00

Allow prototype to be shown with currenttag

This commit is contained in:
Jan Larres
2012-09-09 20:17:44 +12:00
parent a34acf4f63
commit d39a767486
2 changed files with 14 additions and 5 deletions

View File

@@ -3489,11 +3489,13 @@ endfunction
function! tagbar#currenttag(fmt, default, ...) abort
if a:0 > 0
" also test for non-zero value for backwards compatibility
let longsig = a:1 =~# 's' || (type(a:1) == type(0) && a:1 != 0)
let fullpath = a:1 =~# 'f'
let longsig = a:1 =~# 's' || (type(a:1) == type(0) && a:1 != 0)
let fullpath = a:1 =~# 'f'
let prototype = a:1 =~# 'p'
else
let longsig = 0
let fullpath = 0
let longsig = 0
let fullpath = 0
let prototype = 0
endif
if !s:Init(1)
@@ -3503,7 +3505,11 @@ function! tagbar#currenttag(fmt, default, ...) abort
let tag = s:GetNearbyTag(0)
if !empty(tag)
return printf(a:fmt, tag.str(longsig, fullpath))
if prototype
return tag.getPrototype(1)
else
return printf(a:fmt, tag.str(longsig, fullpath))
endif
else
return a:default
endif