mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-18 10:15:56 +08:00
Fix #2835 - Bump up the sign group version check for NeoVim
This commit is contained in:
@@ -23,6 +23,8 @@ let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
|
|||||||
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
|
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
|
||||||
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', 0)
|
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', 0)
|
||||||
|
|
||||||
|
let s:supports_sign_groups = has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
|
|
||||||
if !hlexists('ALEErrorSign')
|
if !hlexists('ALEErrorSign')
|
||||||
highlight link ALEErrorSign error
|
highlight link ALEErrorSign error
|
||||||
endif
|
endif
|
||||||
@@ -149,7 +151,7 @@ function! ale#sign#GetSignName(sublist) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:PriorityCmd() abort
|
function! s:PriorityCmd() abort
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if s:supports_sign_groups
|
||||||
return ' priority=' . g:ale_sign_priority . ' '
|
return ' priority=' . g:ale_sign_priority . ' '
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
@@ -157,7 +159,7 @@ function! s:PriorityCmd() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:GroupCmd() abort
|
function! s:GroupCmd() abort
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if s:supports_sign_groups
|
||||||
return ' group=ale '
|
return ' group=ale '
|
||||||
else
|
else
|
||||||
return ' '
|
return ' '
|
||||||
@@ -175,7 +177,7 @@ function! ale#sign#ReadSigns(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#sign#ParsePattern() abort
|
function! ale#sign#ParsePattern() abort
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if s:supports_sign_groups
|
||||||
" Matches output like :
|
" Matches output like :
|
||||||
" line=4 id=1 group=ale name=ALEErrorSign
|
" line=4 id=1 group=ale name=ALEErrorSign
|
||||||
" строка=1 id=1000001 группа=ale имя=ALEErrorSign
|
" строка=1 id=1000001 группа=ale имя=ALEErrorSign
|
||||||
@@ -460,7 +462,7 @@ endfunction
|
|||||||
|
|
||||||
" Remove all signs.
|
" Remove all signs.
|
||||||
function! ale#sign#Clear() abort
|
function! ale#sign#Clear() abort
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if s:supports_sign_groups
|
||||||
sign unplace group=ale *
|
sign unplace group=ale *
|
||||||
else
|
else
|
||||||
sign unplace *
|
sign unplace *
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Before:
|
|||||||
|
|
||||||
function! CollectSigns()
|
function! CollectSigns()
|
||||||
redir => l:output
|
redir => l:output
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
silent exec 'sign place group=ale'
|
silent exec 'sign place group=ale'
|
||||||
else
|
else
|
||||||
silent exec 'sign place'
|
silent exec 'sign place'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Execute (Parsing English signs should work):
|
Execute (Parsing English signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[9, 1000001, 'ALEWarningSign']]],
|
\ [0, [[9, 1000001, 'ALEWarningSign']]],
|
||||||
\ ale#sign#ParseSigns([
|
\ ale#sign#ParseSigns([
|
||||||
@@ -16,7 +16,7 @@ Execute (Parsing English signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (Parsing Russian signs should work):
|
Execute (Parsing Russian signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[1, 1000001, 'ALEErrorSign']]],
|
\ [0, [[1, 1000001, 'ALEErrorSign']]],
|
||||||
\ ale#sign#ParseSigns([' строка=1 id=1000001 группа=ale имя=ALEErrorSign'])
|
\ ale#sign#ParseSigns([' строка=1 id=1000001 группа=ale имя=ALEErrorSign'])
|
||||||
@@ -27,7 +27,7 @@ Execute (Parsing Russian signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (Parsing Japanese signs should work):
|
Execute (Parsing Japanese signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
||||||
\ ale#sign#ParseSigns([' 行=1 識別子=1000001 グループ=ale 名前=ALEWarningSign'])
|
\ ale#sign#ParseSigns([' 行=1 識別子=1000001 グループ=ale 名前=ALEWarningSign'])
|
||||||
@@ -38,7 +38,7 @@ Execute (Parsing Japanese signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (Parsing Spanish signs should work):
|
Execute (Parsing Spanish signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[12, 1000001, 'ALEWarningSign']]],
|
\ [0, [[12, 1000001, 'ALEWarningSign']]],
|
||||||
\ ale#sign#ParseSigns([' línea=12 id=1000001 grupo=ale nombre=ALEWarningSign'])
|
\ ale#sign#ParseSigns([' línea=12 id=1000001 grupo=ale nombre=ALEWarningSign'])
|
||||||
@@ -49,7 +49,7 @@ Execute (Parsing Spanish signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (Parsing Italian signs should work):
|
Execute (Parsing Italian signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
\ [0, [[1, 1000001, 'ALEWarningSign']]],
|
||||||
\ ale#sign#ParseSigns([' riga=1 id=1000001, gruppo=ale nome=ALEWarningSign'])
|
\ ale#sign#ParseSigns([' riga=1 id=1000001, gruppo=ale nome=ALEWarningSign'])
|
||||||
@@ -60,7 +60,7 @@ Execute (Parsing Italian signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (Parsing German signs should work):
|
Execute (Parsing German signs should work):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [0, [[235, 1000001, 'ALEErrorSign']]],
|
\ [0, [[235, 1000001, 'ALEErrorSign']]],
|
||||||
\ ale#sign#ParseSigns([' Zeile=235 id=1000001 Gruppe=ale Name=ALEErrorSign'])
|
\ ale#sign#ParseSigns([' Zeile=235 id=1000001 Gruppe=ale Name=ALEErrorSign'])
|
||||||
@@ -71,7 +71,7 @@ Execute (Parsing German signs should work):
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
Execute (The sign parser should indicate if the dummy sign is set):
|
Execute (The sign parser should indicate if the dummy sign is set):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [1, [[1, 1000001, 'ALEErrorSign']]],
|
\ [1, [[1, 1000001, 'ALEErrorSign']]],
|
||||||
\ ale#sign#ParseSigns([
|
\ ale#sign#ParseSigns([
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Before:
|
|||||||
|
|
||||||
function! ParseSigns()
|
function! ParseSigns()
|
||||||
redir => l:output
|
redir => l:output
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
silent sign place group=ale
|
silent sign place group=ale
|
||||||
else
|
else
|
||||||
silent sign place
|
silent sign place
|
||||||
@@ -152,7 +152,7 @@ Execute(The current signs should be set for running a job):
|
|||||||
\ ParseSigns()
|
\ ParseSigns()
|
||||||
|
|
||||||
Execute(Loclist items with sign_id values should be kept):
|
Execute(Loclist items with sign_id values should be kept):
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
||||||
exec 'sign place 1000348 group=ale line=15 name=ALEErrorSign buffer=' . bufnr('')
|
exec 'sign place 1000348 group=ale line=15 name=ALEErrorSign buffer=' . bufnr('')
|
||||||
exec 'sign place 1000349 group=ale line=16 name=ALEWarningSign buffer=' . bufnr('')
|
exec 'sign place 1000349 group=ale line=16 name=ALEWarningSign buffer=' . bufnr('')
|
||||||
@@ -297,7 +297,7 @@ Execute(No exceptions should be thrown when setting signs for invalid buffers):
|
|||||||
Execute(Signs should be removed when lines have multiple sign IDs on them):
|
Execute(Signs should be removed when lines have multiple sign IDs on them):
|
||||||
" We can fail to remove signs if there are multiple signs on one line,
|
" We can fail to remove signs if there are multiple signs on one line,
|
||||||
" say after deleting lines in Vim, etc.
|
" say after deleting lines in Vim, etc.
|
||||||
if has('nvim-0.4.0') || (v:version >= 801 && has('patch614'))
|
if has('nvim-0.4.2') || (v:version >= 801 && has('patch614'))
|
||||||
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
exec 'sign place 1000347 group=ale line=3 name=ALEErrorSign buffer=' . bufnr('')
|
||||||
exec 'sign place 1000348 group=ale line=3 name=ALEWarningSign buffer=' . bufnr('')
|
exec 'sign place 1000348 group=ale line=3 name=ALEWarningSign buffer=' . bufnr('')
|
||||||
exec 'sign place 1000349 group=ale line=10 name=ALEErrorSign buffer=' . bufnr('')
|
exec 'sign place 1000349 group=ale line=10 name=ALEErrorSign buffer=' . bufnr('')
|
||||||
|
|||||||
Reference in New Issue
Block a user