Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions autoload/neoformat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions autoload/neoformat/utils.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down