summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-21 13:38:27 +0000
committerw0rp <devw0rp@gmail.com>2017-03-21 13:38:27 +0000
commit3e13e10e033876688c1a6e01fc2c9af9ef65a8ae (patch)
treed6da92d64aef28d1ceac60a96c908726d2685405 /autoload/ale.vim
parent2d1d6fb85011e07a6b5b29f57247254cbc4b8815 (diff)
downloadale-3e13e10e033876688c1a6e01fc2c9af9ef65a8ae.zip
#333 Change arguments for ale#Queue so they are more obvious, and check files in more places
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim11
1 files changed, 6 insertions, 5 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index 2d29c8f7..ce2589bb 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -14,16 +14,17 @@ function! ale#ShouldDoNothing() abort
\ || ale#util#InSandbox()
endfunction
-" (delay, [run_file_linters])
+" (delay, [linting_flag])
function! ale#Queue(delay, ...) abort
if len(a:0) > 1
throw 'too many arguments!'
endif
- let l:a1 = len(a:0) > 1 ? a:1 : 0
+ " Default run_file_linters to 0
+ let l:linting_flag = len(a:0) > 1 ? a:1 : ''
- if type(l:a1) != type(1) || (l:a1 != 0 && l:a1 != 1)
- throw 'The lint_file argument must be a Number which is either 0 or 1!'
+ if l:linting_flag !=# '' && l:linting_flag !=# 'lint_file'
+ throw "linting_flag must be either '' or 'lint_file'"
endif
if ale#ShouldDoNothing()
@@ -31,7 +32,7 @@ function! ale#Queue(delay, ...) abort
endif
" Remember the event used for linting.
- let s:should_lint_file = l:a1
+ let s:should_lint_file = l:linting_flag ==# 'lint_file'
if s:lint_timer != -1
call timer_stop(s:lint_timer)