Fix filename substitution, especially on Windows
This commit is contained in:
parent
ecbb276805
commit
2078255ec3
@ -300,7 +300,7 @@ function! ale#engine#FormatCommand(buffer, command) abort
|
|||||||
" file.
|
" file.
|
||||||
if l:command =~# '%s'
|
if l:command =~# '%s'
|
||||||
let l:filename = fnamemodify(bufname(a:buffer), ':p')
|
let l:filename = fnamemodify(bufname(a:buffer), ':p')
|
||||||
let l:command = substitute(l:command, '%s', fnameescape(l:filename), 'g')
|
let l:command = substitute(l:command, '%s', '\=fnameescape(l:filename)', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:command =~# '%t'
|
if l:command =~# '%t'
|
||||||
@ -311,7 +311,7 @@ function! ale#engine#FormatCommand(buffer, command) abort
|
|||||||
\ . (has('win32') ? '\' : '/')
|
\ . (has('win32') ? '\' : '/')
|
||||||
\ . fnamemodify(bufname(a:buffer), ':t')
|
\ . fnamemodify(bufname(a:buffer), ':t')
|
||||||
|
|
||||||
let l:command = substitute(l:command, '%t', fnameescape(l:temporary_file), 'g')
|
let l:command = substitute(l:command, '%t', '\=fnameescape(l:temporary_file)', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Finish formatting so %% becomes %.
|
" Finish formatting so %% becomes %.
|
||||||
|
Loading…
Reference in New Issue
Block a user