diff options
author | w0rp <devw0rp@gmail.com> | 2018-05-28 17:38:14 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-05-28 17:38:14 +0100 |
commit | 18509195f575c5753d3b30ff87040674cca6ce01 (patch) | |
tree | 01cdfa7745491fe8664fdb8b2cfa26e8f1a05d13 /autoload/ale.vim | |
parent | ce89d93e1c7b0e135ad88414fe1c556b4a4b3c3e (diff) | |
download | ale-18509195f575c5753d3b30ff87040674cca6ce01.zip |
#1524 Do not try to check buffers with empty filetypes
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r-- | autoload/ale.vim | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index 5c4a0f55..725a3958 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -60,23 +60,31 @@ function! ale#ShouldDoNothing(buffer) abort return 1 endif - " Do nothing for blacklisted files - if index(get(g:, 'ale_filetype_blacklist', []), getbufvar(a:buffer, '&filetype')) >= 0 + let l:filetype = getbufvar(a:buffer, '&filetype') + + " Do nothing when there's no filetype. + if l:filetype is# '' + return 1 + endif + + " Do nothing for blacklisted files. + if index(get(g:, 'ale_filetype_blacklist', []), l:filetype) >= 0 return 1 endif - " Do nothing if running from command mode + " Do nothing if running from command mode. if s:getcmdwintype_exists && !empty(getcmdwintype()) return 1 endif let l:filename = fnamemodify(bufname(a:buffer), ':t') + " Do nothing for directories. if l:filename is# '.' return 1 endif - " Do nothing if running in the sandbox + " Do nothing if running in the sandbox. if ale#util#InSandbox() return 1 endif |