mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-02 09:33:31 +08:00
#538 Suport highlight sizes by looking at end column numbers
This commit is contained in:
@@ -288,6 +288,11 @@ function! ale#engine#FixLocList(buffer, linter, loclist) abort
|
||||
let l:item.detail = l:old_item.detail
|
||||
endif
|
||||
|
||||
" Pass on a col_length key if set, used for highlights.
|
||||
if has_key(l:old_item, 'end_col')
|
||||
let l:item.end_col = str2nr(l:old_item.end_col)
|
||||
endif
|
||||
|
||||
if l:item.lnum == 0
|
||||
" When errors appear at line 0, put them at line 1 instead.
|
||||
let l:item.lnum = 1
|
||||
|
||||
@@ -86,7 +86,7 @@ function! ale#highlight#UpdateHighlights() abort
|
||||
let l:col = l:item.col
|
||||
let l:group = l:item.type ==# 'E' ? 'ALEError' : 'ALEWarning'
|
||||
let l:line = l:item.lnum
|
||||
let l:size = 1
|
||||
let l:size = has_key(l:item, 'end_col') ? l:item.end_col - l:col : 1
|
||||
|
||||
" Rememeber the match ID for the item.
|
||||
" This ID will be used to preserve loclist items which are set
|
||||
|
||||
Reference in New Issue
Block a user