#2132 Move CreateTemporaryFileForJob calls into FormatCommand

This commit is contained in:
w0rp
2019-01-12 18:34:17 +00:00
parent 7f176390fc
commit c0b2090fbb
5 changed files with 50 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ endfunction
" %s -> with the current filename
" %t -> with the name of an unused file in a temporary directory
" %% -> with a literal %
function! ale#command#FormatCommand(buffer, executable, command, pipe_file_if_needed) abort
function! ale#command#FormatCommand(buffer, executable, command, pipe_file_if_needed, CreateTemporaryFileForJob) abort
let l:temporary_file = ''
let l:command = a:command
@@ -58,5 +58,7 @@ function! ale#command#FormatCommand(buffer, executable, command, pipe_file_if_ne
let l:command = l:command . ' < ' . ale#Escape(l:temporary_file)
endif
return [l:temporary_file, l:command]
let l:file_created = a:CreateTemporaryFileForJob(a:buffer, l:temporary_file)
return [l:temporary_file, l:command, l:file_created]
endfunction