Skip to content

Commit 00d29fb

Browse files
authored
Merge pull request #222 from SublimeLinter/column-is-optional
Fix: 'column' is optional
2 parents 2b9ef4f + 46385a3 commit 00d29fb

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

linter.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ def find_errors(self, output):
6464
if match['message'].startswith('File ignored'):
6565
continue
6666

67+
column = match.get('column', None)
68+
if column is not None:
69+
# apply line_col_base manually
70+
column = column - 1
71+
6772
yield (
6873
match,
6974
match['line'] - 1, # apply line_col_base manually
70-
match['column'] - 1,
75+
column,
7176
match['ruleId'] if match['severity'] == 2 else '',
7277
match['ruleId'] if match['severity'] == 1 else '',
7378
match['message'],
@@ -76,9 +81,12 @@ def find_errors(self, output):
7681

7782
def reposition_match(self, line, col, m, vv):
7883
match = m.match
79-
if match.get('fatal', False): # parse error
84+
if (
85+
col is None or
86+
match.get('fatal', False) # parse error
87+
):
8088
text = vv.select_line(line)
81-
return line, 0, len(text) # select whole line?
89+
return line, 0, len(text) # select whole line
8290
return super().reposition_match(line, col, m, vv)
8391

8492
# apply line_col_base manually

0 commit comments

Comments
 (0)