Skip to content

Commit

Permalink
Fix diagnostics render for source lines that include tabs.
Browse files Browse the repository at this point in the history
whitequark committed Aug 31, 2015
1 parent 89d137f commit 384aea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pythonparser/diagnostic.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

from __future__ import absolute_import, division, print_function, unicode_literals
from functools import reduce
import sys
import sys, re

class Diagnostic:
"""
@@ -74,7 +74,7 @@ def render(self, only_line=False, colored=False):
:param only_line: (bool) If true, only print line number, not line and column range
"""
source_line = self.location.source_line().rstrip("\n")
highlight_line = bytearray(" ", "utf-8") * len(source_line)
highlight_line = bytearray(re.sub(r"[^\t]", " ", source_line), "utf-8")

for hilight in self.highlights:
if hilight.line() == self.location.line():

0 comments on commit 384aea7

Please sign in to comment.