#538 Fix an off-by-one bug with end columns

This commit is contained in:
w0rp 2017-05-16 19:46:19 +01:00
parent 1b53fa841b
commit e2860f8a26
2 changed files with 3 additions and 3 deletions

View File

@ -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 = has_key(l:item, 'end_col') ? l:item.end_col - l:col : 1
let l:size = has_key(l:item, 'end_col') ? l:item.end_col - l:col + 1 : 1
" Rememeber the match ID for the item.
" This ID will be used to preserve loclist items which are set

View File

@ -146,7 +146,7 @@ Execute(Higlight end columns should set an appropriate size):
AssertEqual
\ [
\ {'group': 'ALEError', 'id': 15, 'priority': 10, 'pos1': [3, 2, 3]},
\ {'group': 'ALEWarning', 'id': 16, 'priority': 10, 'pos1': [4, 1, 4]},
\ {'group': 'ALEError', 'id': 15, 'priority': 10, 'pos1': [3, 2, 4]},
\ {'group': 'ALEWarning', 'id': 16, 'priority': 10, 'pos1': [4, 1, 5]},
\ ],
\ getmatches()