commit c48637fd992b2ae624c5615e7089d2b69faca412
parent c8bb65836047306cd9ce0f2704ce7fe439377e3c
Author: Michael Brauweiler <michael.brauweiler@posteo.de>
Date: Fri, 29 Nov 2019 15:03:27 +0800
Add better echoing of custom wiki2html script
This commit adds a check to the call of the wiki2html script,
so that it is only echoed if it actually produces output.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim
@@ -1437,7 +1437,7 @@ endfunction
function! vimwiki#html#CustomWiki2HTML(path, wikifile, force)
call vimwiki#path#mkdir(a:path)
- echomsg system(vimwiki#vars#get_wikilocal('custom_wiki2html'). ' '.
+ let output = system(vimwiki#vars#get_wikilocal('custom_wiki2html'). ' '.
\ a:force. ' '.
\ vimwiki#vars#get_wikilocal('syntax'). ' '.
\ strpart(vimwiki#vars#get_wikilocal('ext'), 1). ' '.
@@ -1454,6 +1454,10 @@ function! vimwiki#html#CustomWiki2HTML(path, wikifile, force)
\ shellescape(s:root_path(vimwiki#vars#get_bufferlocal('subdir'))) : '-'). ' '.
\ (len(vimwiki#vars#get_wikilocal('custom_wiki2html_args')) > 0 ?
\ vimwiki#vars#get_wikilocal('custom_wiki2html_args') : '-'))
+ " Echo if non void
+ if output !~ "^\s*$"
+ echomsg output
+ endif
endfunction