Skip to content

Commit a143c4f

Browse files
author
whitequark
committedJun 6, 2015
diagnostic.Diagnostic.render: only draw hilights on same line as location.
1 parent 776188b commit a143c4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎pythonparser/diagnostic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def render(self):
7474
highlight_line = bytearray(" ", "utf-8") * len(source_line)
7575

7676
for hilight in self.highlights:
77-
lft, rgt = hilight.column_range()
78-
highlight_line[lft:rgt] = bytearray("~", "utf-8") * (rgt - lft)
77+
if hilight.line() == self.location.line():
78+
lft, rgt = hilight.column_range()
79+
highlight_line[lft:rgt] = bytearray("~", "utf-8") * (rgt - lft)
7980

8081
lft, rgt = self.location.column_range()
8182
if rgt == lft: # Expand zero-length ranges to one ^

0 commit comments

Comments
 (0)
Please sign in to comment.