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:
Horacio Sanson
2019-09-25 17:15:16 +09:00
committed by w0rp
parent 6746eaeaa0
commit 41ff80dc9e
11 changed files with 180 additions and 58 deletions
+9 -5
View File
@@ -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):