mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -2,6 +2,11 @@
|
||||
" Description: Primary code path for the plugin
|
||||
" Manages execution of linters when requested by autocommands
|
||||
|
||||
" Strings used for severity in the echoed message
|
||||
let g:ale_echo_msg_error_str = get(g:, 'ale_echo_msg_error_str', 'Error')
|
||||
let g:ale_echo_msg_info_str = get(g:, 'ale_echo_msg_info_str', 'Info')
|
||||
let g:ale_echo_msg_warning_str = get(g:, 'ale_echo_msg_warning_str', 'Warning')
|
||||
|
||||
let s:lint_timer = -1
|
||||
let s:queued_buffer_number = -1
|
||||
let s:should_lint_file_for_buffer = {}
|
||||
@ -32,8 +37,8 @@ function! ale#CallWithCooldown(timestamp_key, func, arglist) abort
|
||||
endfunction
|
||||
|
||||
" Return 1 if a file is too large for ALE to handle.
|
||||
function! ale#FileTooLarge() abort
|
||||
let l:max = ale#Var(bufnr(''), 'maximum_file_size')
|
||||
function! ale#FileTooLarge(buffer) abort
|
||||
let l:max = getbufvar(a:buffer, 'ale_maximum_file_size', get(g:, 'ale_maximum_file_size', 0))
|
||||
|
||||
return l:max > 0 ? (line2byte(line('$') + 1) > l:max) : 0
|
||||
endfunction
|
||||
@ -46,39 +51,47 @@ function! ale#ShouldDoNothing(buffer) abort
|
||||
" The checks are split into separate if statements to make it possible to
|
||||
" profile each check individually with Vim's profiling tools.
|
||||
|
||||
" Do nothing if ALE is disabled.
|
||||
if !getbufvar(a:buffer, 'ale_enabled', get(g:, 'ale_enabled', 0))
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Don't perform any checks when newer NeoVim versions are exiting.
|
||||
if get(v:, 'exiting', v:null) isnot v:null
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Do nothing for blacklisted files
|
||||
if index(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
|
||||
|
||||
" Do nothing if ALE is disabled.
|
||||
if !ale#Var(a:buffer, 'enabled')
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Do nothing if the file is too large.
|
||||
if ale#FileTooLarge()
|
||||
if ale#FileTooLarge(a:buffer)
|
||||
return 1
|
||||
endif
|
||||
|
||||
|
Reference in New Issue
Block a user