summaryrefslogtreecommitdiff
path: root/ale_linters/vim
diff options
context:
space:
mode:
authorTim Bedard <tpbedard@gmail.com>2020-04-02 22:52:47 -0500
committerTim Bedard <tpbedard@gmail.com>2020-04-02 22:52:47 -0500
commitb800d24212d4c34b42dd388b8cab120b39893866 (patch)
treefcf4276612335a567bd9bba8d6cb1cffbdd34359 /ale_linters/vim
parentbbe5153fcb36dec9860ced33ae8ff0b5d76ac02a (diff)
downloadale-b800d24212d4c34b42dd388b8cab120b39893866.zip
add stdin option for supported vint versions
Diffstat (limited to 'ale_linters/vim')
-rw-r--r--ale_linters/vim/vint.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/ale_linters/vim/vint.vim b/ale_linters/vim/vint.vim
index 65e19126..6b996fa4 100644
--- a/ale_linters/vim/vint.vim
+++ b/ale_linters/vim/vint.vim
@@ -13,12 +13,17 @@ function! ale_linters#vim#vint#GetCommand(buffer, version) abort
let l:warning_flag = ale#Var(a:buffer, 'vim_vint_show_style_issues') ? '-s' : '-w'
+ " Use the --stdin-display-name argument if supported, temp file otherwise.
+ let l:stdin_or_temp = ale#semver#GTE(a:version, [0, 4, 0])
+ \ ? ' --stdin-display-name %s -'
+ \ : ' %t'
+
return '%e'
\ . ' ' . l:warning_flag
\ . (l:can_use_no_color_flag ? ' --no-color' : '')
\ . s:enable_neovim
\ . ' ' . s:format
- \ . ' %t'
+ \ . l:stdin_or_temp
endfunction
let s:word_regex_list = [