#148 Do not run ALE for NERDTree or Unite.vim buffers.
This commit is contained in:
parent
c546f47cc0
commit
73c9a1f965
@ -7,6 +7,7 @@
|
|||||||
if exists('g:loaded_ale')
|
if exists('g:loaded_ale')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:loaded_ale = 1
|
let g:loaded_ale = 1
|
||||||
|
|
||||||
" A flag for detecting if the required features are set.
|
" A flag for detecting if the required features are set.
|
||||||
@ -28,6 +29,19 @@ let g:ale_buffer_info = {}
|
|||||||
|
|
||||||
" User Configuration
|
" User Configuration
|
||||||
|
|
||||||
|
" This option prevents ALE autocmd commands from being run for particular
|
||||||
|
" filetypes which can cause issues.
|
||||||
|
let g:ale_filetype_blacklist = ['nerdtree', 'unite']
|
||||||
|
|
||||||
|
" This function lets you define autocmd commands which blacklist particular
|
||||||
|
" filetypes.
|
||||||
|
function! ALEAutoCMD(events, function_call)
|
||||||
|
execute 'autocmd '
|
||||||
|
\ . a:events
|
||||||
|
\ ' * if index(g:ale_filetype_blacklist, &filetype) < 0 | call '
|
||||||
|
\ . a:function_call
|
||||||
|
endfunction
|
||||||
|
|
||||||
" This Dictionary configures which linters are enabled for which languages.
|
" This Dictionary configures which linters are enabled for which languages.
|
||||||
let g:ale_linters = get(g:, 'ale_linters', {})
|
let g:ale_linters = get(g:, 'ale_linters', {})
|
||||||
|
|
||||||
@ -45,7 +59,7 @@ let g:ale_lint_on_text_changed = get(g:, 'ale_lint_on_text_changed', 1)
|
|||||||
if g:ale_lint_on_text_changed
|
if g:ale_lint_on_text_changed
|
||||||
augroup ALERunOnTextChangedGroup
|
augroup ALERunOnTextChangedGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd TextChanged,TextChangedI * call ale#Queue(g:ale_lint_delay)
|
call ALEAutoCMD('TextChanged,TextChangedI', 'ale#Queue(g:ale_lint_delay)')
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -54,7 +68,7 @@ let g:ale_lint_on_enter = get(g:, 'ale_lint_on_enter', 1)
|
|||||||
if g:ale_lint_on_enter
|
if g:ale_lint_on_enter
|
||||||
augroup ALERunOnEnterGroup
|
augroup ALERunOnEnterGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufEnter,BufRead * call ale#Queue(100)
|
call ALEAutoCMD('BufEnter,BufRead', 'ale#Queue(100)')
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -63,7 +77,7 @@ let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 0)
|
|||||||
if g:ale_lint_on_save
|
if g:ale_lint_on_save
|
||||||
augroup ALERunOnSaveGroup
|
augroup ALERunOnSaveGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWrite * call ale#Queue(0)
|
call ALEAutoCMD('BufWrite', 'ale#Queue(0)')
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -100,7 +114,7 @@ let g:ale_echo_cursor = get(g:, 'ale_echo_cursor', 1)
|
|||||||
if g:ale_echo_cursor
|
if g:ale_echo_cursor
|
||||||
augroup ALECursorGroup
|
augroup ALECursorGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd CursorMoved,CursorHold * call ale#cursor#EchoCursorWarningWithDelay()
|
call ALEAutoCMD('CursorMoved,CursorHold', 'ale#cursor#EchoCursorWarningWithDelay()')
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -122,7 +136,7 @@ let g:ale_warn_about_trailing_whitespace =
|
|||||||
augroup ALECleanupGroup
|
augroup ALECleanupGroup
|
||||||
autocmd!
|
autocmd!
|
||||||
" Clean up buffers automatically when they are unloaded.
|
" Clean up buffers automatically when they are unloaded.
|
||||||
autocmd BufUnload * call ale#cleanup#Buffer(expand('<abuf>'))
|
call ALEAutoCMD('BufUnload', "ale#cleanup#Buffer(expand('<abuf>'))")
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Backwards Compatibility
|
" Backwards Compatibility
|
||||||
|
Loading…
x
Reference in New Issue
Block a user