Additional function for displaying type of a current tag.

Introducing small function for displaying type (kind) of a current tag.
Useful for putting it in the status bar.
This commit is contained in:
gryf authored and gryf committed 2020-01-17 10:26:47 +01:00
1 parent db6f884fc7
commit d864a44a3d
2 files changed
+150

No files matched your search

+11
View File
@@ -910,6 +910,17 @@ tagbar#currenttag({format}, {default} [, {flags}])
%{tagbar#currenttag('[%s] ','')}
< then the function "myfunc" will be shown as "[myfunc()] ".
Additionally you can show the kind (type) of the current tag, using following
function:
tagbar#currenttagtype({format}, {default})
{format} and {default} are treated in the same way as for
tagbar#currenttag function.
Altering previous example, like below: >
%{tagbar#currenttag('[%s] ','')}\ %{tagbar#currenttagtype("(%s) ", '')
< the function "myfunc" will be shown as "[myfunc()] (function)".
Note that if there is an error when processing the current file no error
message will be shown in order to not disrupt the statusline. If the function
doesn't seem to work right open the Tagbar window to see any error messages.