mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-11 09:08:32 +08:00
569 support vim sign group and priority (#2786)
* Use sign-group only on supported vim versions. The sign-group feature is only available in nvim 0.4.0 and vim 8.1.614. * Add priority to ALE signs. This allows users to set a priority to ALE signs to take precedence over other plugin signs.
This commit is contained in:
@@ -21,7 +21,7 @@ Before:
|
||||
let g:ale_set_highlights = 0
|
||||
let g:ale_echo_cursor = 0
|
||||
|
||||
sign unplace *
|
||||
call ale#sign#Clear()
|
||||
|
||||
function! TestCallback(buffer, output)
|
||||
return [
|
||||
@@ -32,16 +32,20 @@ Before:
|
||||
|
||||
function! CollectSigns()
|
||||
redir => l:output
|
||||
silent exec 'sign place'
|
||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
||||
silent exec 'sign place group=ale'
|
||||
else
|
||||
silent exec 'sign place'
|
||||
endif
|
||||
redir END
|
||||
|
||||
let l:actual_sign_list = []
|
||||
|
||||
for l:line in split(l:output, "\n")
|
||||
let l:match = matchlist(l:line, '\v^.*\=(\d+).*\=\d+.*\=(ALE[a-zA-Z]+Sign)')
|
||||
let l:match = matchlist(l:line, ale#sign#ParsePattern())
|
||||
|
||||
if len(l:match) > 0
|
||||
call add(l:actual_sign_list, [l:match[1], l:match[2]])
|
||||
call add(l:actual_sign_list, [l:match[1], l:match[3]])
|
||||
endif
|
||||
endfor
|
||||
|
||||
@@ -60,7 +64,7 @@ After:
|
||||
delfunction CollectSigns
|
||||
|
||||
unlet! g:ale_run_synchronously_callbacks
|
||||
sign unplace *
|
||||
call ale#sign#Clear()
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The signs should be updated after linting is done):
|
||||
|
||||
Reference in New Issue
Block a user