From bfe158d7bdaea4e892ea226f53b2a06f3cabe132 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Mon, 1 Aug 2016 00:00:00 +0200 Subject: [PATCH] Add ingo#msg#VerboseMsg() --- autoload/ingo/msg.vim | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/autoload/ingo/msg.vim b/autoload/ingo/msg.vim index bb1f003..e4a645b 100644 --- a/autoload/ingo/msg.vim +++ b/autoload/ingo/msg.vim @@ -2,12 +2,13 @@ " " DEPENDENCIES: " -" Copyright: (C) 2013-2014 Ingo Karkat +" Copyright: (C) 2013-2016 Ingo Karkat " The VIM LICENSE applies to this script; see ':help copyright'. " " Maintainer: Ingo Karkat " " REVISION DATE REMARKS +" 1.025.007 15-Jul-2016 Add ingo#msg#VerboseMsg(). " 1.019.006 05-May-2014 Add optional a:isBeep argument to " ingo#msg#ErrorMsg(). " 1.009.005 21-Jun-2013 :echomsg sets v:statusmsg itself when there's no @@ -52,6 +53,25 @@ function! ingo#msg#StatusMsg( text, ... ) endif endfunction +function! ingo#msg#VerboseMsg( text, ... ) +"****************************************************************************** +"* PURPOSE: +" Echo a message if 'verbose' is greater or equal 1 (or the optional +" a:verboselevel). +"* ASSUMPTIONS / PRECONDITIONS: +" None. +"* EFFECTS / POSTCONDITIONS: +" None. +"* INPUTS: +" a:text The message to be echoed in verbose mode. +"* RETURN VALUES: +" None. +"****************************************************************************** + if &verbose >= (a:0 ? a:1 : 1) + echomsg a:text + endif +endfunction + function! ingo#msg#WarningMsg( text ) let v:warningmsg = a:text call ingo#msg#HighlightMsg(v:warningmsg, 'WarningMsg')