2010/5/26 Mattias Gärtner : >> line by line basis, but I doubt that is the best way of doing it, >> because it will also produce problems with things like comment blocks. > > AFAIK they do. Because regex can not count nor save states, you need a state > machine, which selects which set of regex to use.
I guess I will have to delve into the jEdit code, as that is extremely fast no matter the file size. So clearly following there design should yield very good results. > Graeme, when you start implementing a highlighting machine, you might want > to consider code folding too. Umm, personally I hate code folding, but it might be useful to some. The "rich edit/view" component I want to create will be used as a programming editor, but I would also like it to be used as the RichView component used in DocView. Docview's current "richview" component is only a read-only component which supports Unicode text, varying fonts, varying fonts on the same line, embedded images, margins, varying text colors, hyper links etc... I would like to see if I can implement all that and editing/syntax highlighting in a single component, plus adding "elastic tabstops" support to boot. A tall order, but so far a very interesting exercise. I have already learned a whole bunch of things I never knew about editors. :) For example, the various designs for managing the buffer: Gap buffer, linked lists, Piece Chains, etc... pretty amazing stuff. -- Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
