diff --git a/autoload/neoformat.vim b/autoload/neoformat.vim index 7891c83d..9352233f 100644 --- a/autoload/neoformat.vim +++ b/autoload/neoformat.vim @@ -78,7 +78,10 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort let stdin = getbufline(bufnr('%'), a:start_line, a:end_line) let original_buffer = getbufline(bufnr('%'), 1, '$') - call neoformat#utils#log(stdin) + " include stdin in output only if specified + if !neoformat#utils#should_be_compact() + call neoformat#utils#log(stdin) + endif call neoformat#utils#log(cmd.exe) if cmd.stdin @@ -96,13 +99,16 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort let stdout = readfile(cmd.tmp_file_path) endif - call neoformat#utils#log(stdout) + " include stdout in output only if specified + if !neoformat#utils#should_be_compact() + call neoformat#utils#log(stdout) + endif call neoformat#utils#log(cmd.valid_exit_codes) call neoformat#utils#log(v:shell_error) let process_ran_succesfully = index(cmd.valid_exit_codes, v:shell_error) != -1 - + if cmd.stderr_log != '' call neoformat#utils#log('stderr output redirected to file' . cmd.stderr_log) call neoformat#utils#log_file_content(cmd.stderr_log) diff --git a/autoload/neoformat/utils.vim b/autoload/neoformat/utils.vim index 06fe933f..6b8e36dc 100644 --- a/autoload/neoformat/utils.vim +++ b/autoload/neoformat/utils.vim @@ -28,6 +28,13 @@ function! neoformat#utils#should_be_verbose() abort return &verbose || g:neoformat_verbose endfunction +function! neoformat#utils#should_be_compact() abort + if !exists('g:neoformat_compact') + let g:neoformat_compact = 1 + endif + return g:neoformat_compact +endfunction + function! s:better_echo(msg) abort if type(a:msg) != type('') echom 'Neoformat: ' . string(a:msg)