diff options
author | w0rp <devw0rp@gmail.com> | 2019-06-10 22:41:20 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-06-10 22:41:20 +0100 |
commit | ce91972c947dbd3f6fe9408b8ae89b824b4c4fa7 (patch) | |
tree | 4c8429582b3746c29c174dee499cdc133b37063c /autoload | |
parent | 168768b32667b244e0afdc8da851d91ab95d6e2f (diff) | |
download | ale-ce91972c947dbd3f6fe9408b8ae89b824b4c4fa7.zip |
Fix #1727 - Replace previoulsy defined linters with matching names
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/linter.vim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index 6a714d6a..78dcd3a2 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -358,12 +358,14 @@ function! ale#linter#Define(filetype, linter) abort " This command will throw from the sandbox. let &l:equalprg=&l:equalprg + let l:new_linter = ale#linter#PreProcess(a:filetype, a:linter) + if !has_key(s:linters, a:filetype) let s:linters[a:filetype] = [] endif - let l:new_linter = ale#linter#PreProcess(a:filetype, a:linter) - + " Remove previously defined linters with the same name. + call filter(s:linters[a:filetype], 'v:val.name isnot# a:linter.name') call add(s:linters[a:filetype], l:new_linter) endfunction |