From 3bdcb748fe04d57c0e1c9dd86fc47f20ea027088 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Mon, 19 Mar 2018 13:08:41 +0100 Subject: [PATCH] Fallback if 'endLine' and 'endColumn' is not present Fixes #231 --- linter.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/linter.py b/linter.py index f29becf..ab79788 100644 --- a/linter.py +++ b/linter.py @@ -84,16 +84,14 @@ def reposition_match(self, line, col, m, vv): match = m.match if ( col is None or - match.get('fatal', False) # parse error + 'endLine' not in match or + 'endColumn' not in match ): - text = vv.select_line(line) - return line, 0, len(text) # select whole line return super().reposition_match(line, col, m, vv) # apply line_col_base manually - end_line = match.get('endLine', line + 1) - 1 - # to ensure a length of 1, add 2 to the starting col - end_column = match.get('endColumn', col + 2) - 1 + end_line = match['endLine'] - 1 + end_column = match['endColumn'] - 1 for _line in range(line, end_line): text = vv.select_line(_line)