[Lazarus] About 0013268: SynEdit parses every line twice on load or paste (Attn: Flávio)

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Mar 5 09:29:39 CET 2009


Flávio Etrusco schrieb:

> Calling BeginUpdate is not enough, they must disable/unset the
> highlighter to avoid the double parse.

I found it sufficient when the highlighter only parses the current 
line(s) while painting the text. When the highlighter information is 
reduced to a flag, indicating continuation lines in multi-line comments, 
this flag can be stored together with the informaton about the line 
begin in the text (line number table). Then the determination of the 
line positions can be done by the highlighter/parser base class. Later, 
when text is displayed, the continuation flag of the current line is 
passed to the highlighter, so that only the requested line has to be parsed.

Things can become more complicated, of course, when e.g. matching pairs 
(begin-end, parentheses...) shall be highlighted dynamically.

DoDi




More information about the Lazarus mailing list