diff options
author | w0rp <devw0rp@gmail.com> | 2017-08-23 21:41:29 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-08-23 21:41:29 +0100 |
commit | 623fdf212cd70131df4d3c52de26d9d1faa5d90e (patch) | |
tree | c2e98dbffcc9abf65d4a656ddc3e867dee74e55c /autoload/ale/debugging.vim | |
parent | 0507503aa755587892e8841a749dc0ca8641a6f8 (diff) | |
download | ale-623fdf212cd70131df4d3c52de26d9d1faa5d90e.zip |
Include executable checks in ALEInfo
Diffstat (limited to 'autoload/ale/debugging.vim')
-rw-r--r-- | autoload/ale/debugging.vim | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/autoload/ale/debugging.vim b/autoload/ale/debugging.vim index 80d253e1..0042bd3c 100644 --- a/autoload/ale/debugging.vim +++ b/autoload/ale/debugging.vim @@ -70,39 +70,57 @@ function! s:EchoGlobalVariables() abort endfor endfunction -function! s:EchoCommandHistory() abort - let l:buffer = bufnr('%') +" Echo a command that was run. +function! s:EchoCommand(item) abort + let l:status_message = a:item.status - if !has_key(g:ale_buffer_info, l:buffer) - return + " Include the exit code in output if we have it. + if a:item.status is# 'finished' + let l:status_message .= ' - exit code ' . a:item.exit_code endif - for l:item in g:ale_buffer_info[l:buffer].history - let l:status_message = l:item.status + echom '(' . l:status_message . ') ' . string(a:item.command) - " Include the exit code in output if we have it. - if l:item.status is# 'finished' - let l:status_message .= ' - exit code ' . l:item.exit_code + if g:ale_history_log_output && has_key(a:item, 'output') + if empty(a:item.output) + echom '' + echom '<<<NO OUTPUT RETURNED>>>' + echom '' + else + echom '' + echom '<<<OUTPUT STARTS>>>' + + for l:line in a:item.output + echom l:line + endfor + + echom '<<<OUTPUT ENDS>>>' + echom '' endif + endif +endfunction - echom '(' . l:status_message . ') ' . string(l:item.command) +" Echo the results of an executable check. +function! s:EchoExecutable(item) abort + echom printf( + \ '(executable check - %s) %s', + \ a:item.status ? 'success' : 'failure', + \ a:item.command, + \) +endfunction - if g:ale_history_log_output && has_key(l:item, 'output') - if empty(l:item.output) - echom '' - echom '<<<NO OUTPUT RETURNED>>>' - echom '' - else - echom '' - echom '<<<OUTPUT STARTS>>>' +function! s:EchoCommandHistory() abort + let l:buffer = bufnr('%') - for l:line in l:item.output - echom l:line - endfor + if !has_key(g:ale_buffer_info, l:buffer) + return + endif - echom '<<<OUTPUT ENDS>>>' - echom '' - endif + for l:item in g:ale_buffer_info[l:buffer].history + if l:item.job_id is# 'executable' + call s:EchoExecutable(l:item) + else + call s:EchoCommand(l:item) endif endfor endfunction |