From e2860f8a26dc9c04bb4ad6fb59ffb8c743717149 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 16 May 2017 19:46:19 +0100 Subject: [PATCH] #538 Fix an off-by-one bug with end columns --- autoload/ale/highlight.vim | 2 +- test/test_highlight_placement.vader | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/ale/highlight.vim b/autoload/ale/highlight.vim index b51e5b2d..4ac1d1e4 100644 --- a/autoload/ale/highlight.vim +++ b/autoload/ale/highlight.vim @@ -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 diff --git a/test/test_highlight_placement.vader b/test/test_highlight_placement.vader index e43b0dc1..b5878922 100644 --- a/test/test_highlight_placement.vader +++ b/test/test_highlight_placement.vader @@ -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()