From 705f4232c0920a7d1e3f4b70f06fc982015a43d7 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 4 Oct 2016 13:50:44 +0100 Subject: Add support for formatting filenames into commands, and use it to fix linting with older eslint versions. --- plugin/ale/zmain.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugin') diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim index 26085b66..3cfe28db 100644 --- a/plugin/ale/zmain.vim +++ b/plugin/ale/zmain.vim @@ -154,6 +154,12 @@ function! s:ApplyLinter(buffer, linter) let command = a:linter.command endif + if command =~# '%s' + " If there is a '%s' in the command string, replace it with the name + " of the file. + let command = printf(command, shellescape(getbufinfo(a:buffer)[0].name)) + endif + if has('nvim') if a:linter.output_stream ==# 'stderr' " Read from stderr instead of stdout. -- cgit v1.2.3