New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt console doesn't work with pygments 2.0rc1 #6877
Comments
Oh dear, it looks like we're monkeypatching pygments. Let's try to eliminate said monkeypatch if it's at all possible. |
Where is that monkeypatch? |
Removing the patch works. I'll investigate what other effects this change has. |
Thanks! I'm reading code trying to work out why it was monkeypatched in the first place. |
Ok, thanks! |
After reading pygments sources, it seems that changing this https://github.com/ipython/ipython/blob/master/IPython/qt/console/pygments_highlighter.py#L27 to if action is not None:
if type(action) is _TokenType:
yield pos, action, m.group()
else:
for item in action(self, m):
yield item solves the problem without further efforts ;-) |
Hmmm. I'd really like to get rid of the monkeypatch properly, rather than just updating it to work with pygments at the moment. |
I understand. It's your call then. |
I have at least discovered what it's there for - highlighting inside multi-line strings goes wrong if I remove the monkeypatch. Now to find a better way to do it. |
I couldn't think of a good way to do this, so #6878 keeps the monkeypatch alive, as @ccordoba12 suggested. |
… Pygments 2.0 Closes gh-6877 I spent a while looking for a better way to achive this, to get rid of the monkeypatch, but none occurred to me, so I went with Carlos' suggestion of just updating it.
We have received two reports about this in Spyder already :-) This is the one I'll maintain open until it's fixed here:
https://code.google.com/p/spyderlib/issues/detail?id=2042
I'll see if I can solve this one given that you're busy with 3.0
The text was updated successfully, but these errors were encountered: