code folding in PythonWin (scintilla)

Neil Hodgson neilh at
Fri Sep 22 03:25:32 CEST 2000

> Is there some way to control the characteristics of code folding in
> PythonWin?

   Yes, but it requires some C++ coding work. Folding is currently
implemented by the lexer code which is written in C++ (LexPython.cxx in the
Scintilla sources) and so modifying it will require changes to this C++
code. There was a version of the lexer written in Python and it could be
resurrected but Mark moved to Scintilla's inbuilt lexer as it is less work
to only maintain one implementation.

> I want to (1) create some sort of user fold point, so that I can fold away
> large blocks of comments, and

   This is possible but it does not fit in easily with the current folding

> (2) try to stop it from hiding within a
> previous fold, comments that are placed just before a new top-level
> construct, eg.

   This is easier. Various tweaks to make comments and empty lines associate
differently have been asked for. If no one else implements this, I'll
eventually find some time to do it.


More information about the Python-list mailing list