Skip to content

Commit

Permalink
diagnostic.Diagnostic.render: only draw hilights on same line as loca…
Browse files Browse the repository at this point in the history
…tion.
whitequark committed Jun 6, 2015
1 parent 776188b commit a143c4f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pythonparser/diagnostic.py
Original file line number Diff line number Diff line change
@@ -74,8 +74,9 @@ def render(self):
highlight_line = bytearray(" ", "utf-8") * len(source_line)

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

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

0 comments on commit a143c4f

Please sign in to comment.