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.
This commit is contained in:
Michael Brauweiler 2019-11-29 15:03:27 +08:00
parent c8bb658360
commit c48637fd99
No known key found for this signature in database
GPG Key ID: E5171BDE27722F59

View File

@ -1437,7 +1437,7 @@ endfunction
function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) function! vimwiki#html#CustomWiki2HTML(path, wikifile, force)
call vimwiki#path#mkdir(a:path) 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. ' '. \ a:force. ' '.
\ vimwiki#vars#get_wikilocal('syntax'). ' '. \ vimwiki#vars#get_wikilocal('syntax'). ' '.
\ strpart(vimwiki#vars#get_wikilocal('ext'), 1). ' '. \ 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'))) : '-'). ' '. \ shellescape(s:root_path(vimwiki#vars#get_bufferlocal('subdir'))) : '-'). ' '.
\ (len(vimwiki#vars#get_wikilocal('custom_wiki2html_args')) > 0 ? \ (len(vimwiki#vars#get_wikilocal('custom_wiki2html_args')) > 0 ?
\ vimwiki#vars#get_wikilocal('custom_wiki2html_args') : '-')) \ vimwiki#vars#get_wikilocal('custom_wiki2html_args') : '-'))
" Echo if non void
if output !~ "^\s*$"
echomsg output
endif
endfunction endfunction