mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-26 05:51:08 +08:00
Support formatting escaped executable names into commands with %e
This commit is contained in:
@@ -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, command, pipe_file_if_needed) abort
|
||||
function! ale#command#FormatCommand(buffer, executable, command, pipe_file_if_needed) abort
|
||||
let l:temporary_file = ''
|
||||
let l:command = a:command
|
||||
|
||||
@@ -28,6 +28,11 @@ function! ale#command#FormatCommand(buffer, command, pipe_file_if_needed) abort
|
||||
" with an ugly string.
|
||||
let l:command = substitute(l:command, '%%', '<<PERCENTS>>', 'g')
|
||||
|
||||
" Replace %e with the escaped executable, if available.
|
||||
if !empty(a:executable) && l:command =~# '%e'
|
||||
let l:command = substitute(l:command, '%e', '\=ale#Escape(a:executable)', 'g')
|
||||
endif
|
||||
|
||||
" Replace all %s occurrences in the string with the name of the current
|
||||
" file.
|
||||
if l:command =~# '%s'
|
||||
|
||||
Reference in New Issue
Block a user