summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2016-09-19 07:18:55 +0100
committerGitHub <noreply@github.com>2016-09-19 07:18:55 +0100
commita39274d7f4ee3420d5cbd4c73bba395df6870e64 (patch)
treef21eb163b7b8aacfa0042fb4c630c2bcf6c94ea6 /plugin
parentf8899f9ba70924d713dfff521a46123c0983dfbe (diff)
parentf346416f46369edf37004f16bfcf34704bb0200b (diff)
downloadale-a39274d7f4ee3420d5cbd4c73bba395df6870e64.zip
Merge pull request #9 from prashcr/master
Add option for choosing linters to run
Diffstat (limited to 'plugin')
-rw-r--r--plugin/ale/zmain.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin/ale/zmain.vim b/plugin/ale/zmain.vim
index 5547f695..2229c34c 100644
--- a/plugin/ale/zmain.vim
+++ b/plugin/ale/zmain.vim
@@ -7,6 +7,10 @@ let g:loaded_ale_zmain = 1
let s:lint_timer = -1
let s:linters = {}
+if !exists('g:ale_linters')
+ let g:ale_linters = {}
+endif
+
" Stores information for each job including:
"
" linter: The linter dictionary for the job.
@@ -262,6 +266,17 @@ function! ALEGetLinters(filetype)
return []
endif
+ if has_key(g:ale_linters, a:filetype)
+ let linters = []
+ " Filter loaded linters according to list of linters specified in option
+ for linter in s:linters[a:filetype]
+ if index(g:ale_linters[a:filetype], linter.name) != -1
+ call add(linters, linter)
+ endif
+ endfor
+ return linters
+ endif
+
return s:linters[a:filetype]
endfunction