From dab8d99fb8ebb45fcaca47b518f37770b37393c8 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 24 Aug 2013 17:57:33 +1200 Subject: [PATCH] Print message if no tags have been found in file --- autoload/tagbar.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 2bb123c..b8dd6d9 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -2541,8 +2541,17 @@ function! s:RenderContent(...) abort let typeinfo = fileinfo.typeinfo - " Print tags - call s:PrintKinds(typeinfo, fileinfo) + if !empty(fileinfo.tags) + " Print tags + call s:PrintKinds(typeinfo, fileinfo) + else + call s:LogDebugMessage('No tags found, skipping printing.') + if g:tagbar_compact && s:short_help + silent 0put ='\" No tags found.' + else + silent put ='\" No tags found.' + endif + endif " Delete empty lines at the end of the buffer for linenr in range(line('$'), 1, -1)