mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix #604 - Support highlights spanning many lines
This commit is contained in:
@@ -31,6 +31,8 @@ Before:
|
||||
highlight link SomeOtherGroup SpellBad
|
||||
|
||||
After:
|
||||
unlet! g:items
|
||||
|
||||
delfunction GenerateResults
|
||||
call ale#linter#Reset()
|
||||
let g:ale_buffer_info = {}
|
||||
@@ -173,3 +175,27 @@ Execute(Higlight end columns should set an appropriate size):
|
||||
\ {'group': 'ALEInfo', 'id': 23, 'priority': 10, 'pos1': [7, 1, 1]},
|
||||
\ ],
|
||||
\ getmatches()
|
||||
|
||||
Execute(Highlighting should support errors spanning many lines):
|
||||
let g:items = [
|
||||
\ {'bufnr': bufnr(''), 'type': 'E', 'lnum': 1, 'col': 1, 'end_lnum': 10, 'end_col': 3},
|
||||
\]
|
||||
|
||||
call ale#highlight#SetHighlights(bufnr(''), g:items)
|
||||
|
||||
" We should set 2 highlights for the item, as we can only add 8 at a time.
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'group': 'ALEError', 'id': 24, 'priority': 10, 'pos1': [1, 1, 1073741824],
|
||||
\ 'pos2': [2], 'pos3': [3], 'pos4': [4], 'pos5': [5], 'pos6': [6],
|
||||
\ 'pos7': [7], 'pos8': [8],
|
||||
\ },
|
||||
\ {
|
||||
\ 'group': 'ALEError', 'id': 25, 'priority': 10,
|
||||
\ 'pos1': [9], 'pos2': [10, 1, 3]
|
||||
\ },
|
||||
\ ],
|
||||
\ getmatches()
|
||||
|
||||
AssertEqual [[24, 25]], map(copy(g:items), 'v:val.match_id_list')
|
||||
|
||||
Reference in New Issue
Block a user