http://www.scintilla.org/
I don't have now a deeper look, but there is talking about folding and many more stuff.
Code: Select all
o Text retrieval and modification
o Searching and replacing
o Overtype
o Cut, copy and paste
o Error handling
o Undo and Redo
o Selection and information
o Scrolling and automatic scrolling
o White space
o Cursor
o Mouse capture
o Line endings
o Styling
o Style definition
o Caret, selection, and hotspot styles
o Margins
o Other settings
o Brace highlighting
o Tabs and Indentation Guides
o Markers
o Indicators
o Autocompletion
o User lists
o Call tips
o Keyboard commands
o Key bindings
o Popup edit menu
o Macro recording
o Printing
o Direct access
o Multiple views
o Folding
o Line wrapping
o Zooming
o Long lines
o Lexer
o Notifications
o Deprecated messages
o Edit messages never supported by Scintilla
o Building Scintilla
Take a look
GPI