fixup! Put a 'reset' color in front of the highlighting
This commit is contained in:
parent
e2880b7879
commit
e16a67af87
|
@ -225,6 +225,10 @@ class TerminalWriter:
|
||||||
)
|
)
|
||||||
if highlighted[-1] == "\n" and source[-1] != "\n":
|
if highlighted[-1] == "\n" and source[-1] != "\n":
|
||||||
highlighted = highlighted[:-1]
|
highlighted = highlighted[:-1]
|
||||||
|
|
||||||
|
# Some lexers will not set the initial color explicitly
|
||||||
|
# which may lead to the previous color being propagated to the
|
||||||
|
# start of the expression
|
||||||
return "\x1b[0m" + highlighted
|
return "\x1b[0m" + highlighted
|
||||||
except pygments.util.ClassNotFound:
|
except pygments.util.ClassNotFound:
|
||||||
raise UsageError(
|
raise UsageError(
|
||||||
|
|
Loading…
Reference in New Issue