From a2b7bf1161b8764b4f72869246e876b061fa47b6 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 13 Apr 2017 22:46:25 -0700 Subject: [PATCH] better formatted error message --- plugin/wakatime.vim | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/plugin/wakatime.vim b/plugin/wakatime.vim index 50b8939..48cfcb7 100644 --- a/plugin/wakatime.vim +++ b/plugin/wakatime.vim @@ -184,25 +184,21 @@ let s:VERSION = '4.0.14' let cmd = cmd + ['--language', &filetype] endif endif - if s:is_debug_mode_on - echo 'Sending Heartbeat with Command: ' . s:JoinArgs(cmd) - endif + let stdout = '' if s:IsWindows() if s:is_debug_mode_on let stdout = system('(' . s:JoinArgs(cmd) . ')') - if stdout != '' - echo stdout - endif else exec 'silent !start /min cmd /c "' . s:JoinArgs(cmd) . '"' endif else let stdout = system(s:JoinArgs(cmd) . ' &') - if s:is_debug_mode_on && stdout != '' - echo stdout - endif endif call s:SetLastHeartbeat(a:time, a:time, file) + if s:is_debug_mode_on && stdout != '' + echo '[WakaTime] Heartbeat Command: ' . s:JoinArgs(cmd) + echo '[WakaTime] Error: ' . stdout + endif endif endfunction