venantius/pyro

Pyro source prints don't properly reset colors when the source code ends in a string.

Opened this issue · 1 comments

For reasons I haven't been able to figure out, Pyro doesn't successfully reset printed source colors if the ending lines are a Clojure string. For example:

screen shot 2018-02-17 at 12 27 58 pm

This can probably be easily fixed by just always printing an ANSI reset code at the end of any source-quoting.

This turns out to be a harder problem to fix than initially anticipated, because we don't have a mechanism for keeping track of the color once it's been syntax-highlighted. This suggests to me that what we might end up needing to do is to plug some new features into Glow itself. There's a quick hack we can do to prevent color from bleeding outside of the quoted source itself but regrettably it won't stop things like highlighting the line numbers.