Respect the 'verbose' option

This allows for easier on-the-fly debug (e.g., ":verbose w") and also
makes it easy to leverage 'verbosefile'.

Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
James McCoy
2020-11-07 23:16:08 -05:00
parent 90b86c542c
commit c8de2bb17c

View File

@@ -1206,7 +1206,7 @@ endfunction
" only define function if GPGDebugLevel set at all " only define function if GPGDebugLevel set at all
" "
function s:GPGDebug(level, text) function s:GPGDebug(level, text)
if exists("g:GPGDebugLevel") && g:GPGDebugLevel >= a:level if get(g:, 'GPGDebugLevel', 0) >= a:level || &verbose >= a:level
if exists("g:GPGDebugLog") if exists("g:GPGDebugLog")
execute "redir >> " . g:GPGDebugLog execute "redir >> " . g:GPGDebugLog
silent echom "GnuPG: " . a:text silent echom "GnuPG: " . a:text