mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-25 21:41:10 +08:00
#538 Suport highlight sizes by looking at end column numbers
This commit is contained in:
@@ -137,3 +137,16 @@ Execute(Only ALE highlights should be restored when buffers are restored):
|
||||
|
||||
" Only our matches should appear again.
|
||||
AssertEqual 1, len(getmatches()), 'The highlights weren''t set again!'
|
||||
|
||||
Execute(Higlight end columns should set an appropriate size):
|
||||
call ale#highlight#SetHighlights(bufnr('%'), [
|
||||
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2, 'end_col': 5},
|
||||
\ {'bufnr': bufnr('%'), 'type': 'W', 'lnum': 4, 'col': 1, 'end_col': 5},
|
||||
\])
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {'group': 'ALEError', 'id': 15, 'priority': 10, 'pos1': [3, 2, 3]},
|
||||
\ {'group': 'ALEWarning', 'id': 16, 'priority': 10, 'pos1': [4, 1, 4]},
|
||||
\ ],
|
||||
\ getmatches()
|
||||
|
||||
@@ -128,3 +128,39 @@ Execute(FixLocList should convert line and column numbers correctly):
|
||||
\ {'name': 'foobar'},
|
||||
\ [{'text': 'a', 'lnum': '010', 'col': '010'}],
|
||||
\ )
|
||||
|
||||
Execute(FixLocList should pass on col_length values):
|
||||
" The numbers should be 10, not 8 as octals.
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 10,
|
||||
\ 'end_col': 12,
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'vcol': 0,
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
\ 'linter_name': 'foobar',
|
||||
\ },
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 11,
|
||||
\ 'end_col': 12,
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'vcol': 0,
|
||||
\ 'type': 'E',
|
||||
\ 'nr': -1,
|
||||
\ 'linter_name': 'foobar',
|
||||
\ },
|
||||
\],
|
||||
\ ale#engine#FixLocList(
|
||||
\ bufnr('%'),
|
||||
\ {'name': 'foobar'},
|
||||
\ [
|
||||
\ {'text': 'a', 'lnum': '010', 'col': '010', 'end_col': '012'},
|
||||
\ {'text': 'a', 'lnum': '010', 'col': '011', 'end_col': 12},
|
||||
\ ],
|
||||
\ )
|
||||
|
||||
Reference in New Issue
Block a user