mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-08 10:51:06 +08:00
add ALEToggle command (#303)
* add ALEToggle command * stop active jobs when toggled off * small logic cleanup & ensure ale can be ran manually while toggled off
This commit is contained in:
@@ -166,18 +166,7 @@ function! s:HandleExit(job) abort
|
||||
let g:ale_buffer_info[l:buffer].loclist = g:ale_buffer_info[l:buffer].new_loclist
|
||||
let g:ale_buffer_info[l:buffer].new_loclist = []
|
||||
|
||||
if g:ale_set_quickfix || g:ale_set_loclist
|
||||
call ale#list#SetLists(g:ale_buffer_info[l:buffer].loclist)
|
||||
endif
|
||||
|
||||
if g:ale_set_signs
|
||||
call ale#sign#SetSigns(l:buffer, g:ale_buffer_info[l:buffer].loclist)
|
||||
endif
|
||||
|
||||
if exists('*ale#statusline#Update')
|
||||
" Don't load/run if not already loaded.
|
||||
call ale#statusline#Update(l:buffer, g:ale_buffer_info[l:buffer].loclist)
|
||||
endif
|
||||
call ale#engine#SetResults(l:buffer, g:ale_buffer_info[l:buffer].loclist)
|
||||
|
||||
" Call user autocommands. This allows users to hook into ALE's lint cycle.
|
||||
silent doautocmd User ALELint
|
||||
@@ -186,6 +175,21 @@ function! s:HandleExit(job) abort
|
||||
" matchadd('ALEError', '\%200l\%17v')
|
||||
endfunction
|
||||
|
||||
function! ale#engine#SetResults(buffer, loclist) abort
|
||||
if g:ale_set_quickfix || g:ale_set_loclist
|
||||
call ale#list#SetLists(a:loclist)
|
||||
endif
|
||||
|
||||
if g:ale_set_signs
|
||||
call ale#sign#SetSigns(a:buffer, a:loclist)
|
||||
endif
|
||||
|
||||
if exists('*ale#statusline#Update')
|
||||
" Don't load/run if not already loaded.
|
||||
call ale#statusline#Update(a:buffer, a:loclist)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:HandleExitNeoVim(job, data, event) abort
|
||||
call s:HandleExit(a:job)
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user