mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-25 01:38:41 +08:00
#1524 Do not try to check buffers with empty filetypes
This commit is contained in:
+12
-4
@@ -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 if running from command mode
|
||||
" 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.
|
||||
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
|
||||
|
||||
@@ -98,11 +98,13 @@ endfunction
|
||||
" Register a temporary file to be managed with the ALE engine for
|
||||
" a current job run.
|
||||
function! ale#engine#ManageFile(buffer, filename) abort
|
||||
call ale#engine#InitBufferInfo(a:buffer)
|
||||
call add(g:ale_buffer_info[a:buffer].temporary_file_list, a:filename)
|
||||
endfunction
|
||||
|
||||
" Same as the above, but manage an entire directory.
|
||||
function! ale#engine#ManageDirectory(buffer, directory) abort
|
||||
call ale#engine#InitBufferInfo(a:buffer)
|
||||
call add(g:ale_buffer_info[a:buffer].temporary_directory_list, a:directory)
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user