summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-14 21:02:49 +0000
committerw0rp <devw0rp@gmail.com>2017-02-14 21:02:49 +0000
commitc460602cbbf80c1b1b3f006ae3dd28528a80c17c (patch)
tree24b369ae545aecf856915ebae65bc6e913050c8f /autoload/ale.vim
parent78135103fbc6d1d4107f3eef448828c1498f9bcf (diff)
downloadale-c460602cbbf80c1b1b3f006ae3dd28528a80c17c.zip
#338 Try and stop ALE from throwing ALEs when run from a sandbox
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim15
1 files changed, 11 insertions, 4 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index a5251f64..c81a57a6 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -4,9 +4,17 @@
let s:lint_timer = -1
+" A function for checking various conditions whereby ALE just shouldn't
+" attempt to do anything, say if particular buffer types are open in Vim.
+function! ale#ShouldDoNothing() abort
+ " Do nothing for blacklisted files
+ " OR if ALE is running in the sandbox
+ return index(g:ale_filetype_blacklist, &filetype) >= 0
+ \ || ale#util#InSandbox()
+endfunction
+
function! ale#Queue(delay) abort
- " Do nothing for blacklisted files.
- if index(g:ale_filetype_blacklist, &filetype) >= 0
+ if ale#ShouldDoNothing()
return
endif
@@ -29,8 +37,7 @@ function! ale#Queue(delay) abort
endfunction
function! ale#Lint(...) abort
- " Do nothing for blacklisted files.
- if index(g:ale_filetype_blacklist, &filetype) >= 0
+ if ale#ShouldDoNothing()
return
endif