[Pythonmac-SIG] Step-by-step howto for testing new Mach{ho}Python architecture
Just van Rossum
just@letterror.com
Wed, 7 Aug 2002 15:44:58 +0200
Dan Grassi wrote:
> I suggest including the syntax coloring into the IDE. Syntax coloring
> is now expected and it can be disabled easily. I would be willing to do
> the work.
A bad implementation of syntax coloring has been hiding in the IDE for a while:
edit line 679 to read
self.do_fontify = 1
(Re)start the IDE and you're laughing.
It's bad in the sense that:
1) It doesn't do the right thing when editing triple quoted strings
(That's why there is a secret shortcut which recolors the entire
document:cmd-shift-d.)
2) It _sometimes_ traces back in PyFontify in some of the complex regexen
(this is probably due to sre, but I never bothered to research the
problem)
3) It is slow becuase it does it's work as idle callbacks, which are
scheduled fairly low-frequently by the event loop.
4) Neither fonts nor colors are settable with a GUI.
I now think that the whole PyFontify approach is flawed, and that it's not
really suitable for live coloring. Either we need to copy what IDLE is doing,
or, and THAT would be a MAJORLY exciting enhancement of the IDE, is to switch to
Scintilla as the text component instead of waste. Then we get _folding_ for free
as well! I usually don't like to shout in emails, but THIS WOULD BE EXTREMELY
COOL ;-) Scintilla is what PythonWin uses.
Problem is: it needs to be ported to Carbon. Problem #2 for _me_ is: it's in
C++, which I can't write. Anyone, please check out http://www.scintilla.org/ if
you're interested in a project.
Just