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

Martin Friebe lazarus at mfriebe.de
Thu Mar 5 21:37:15 CET 2009


Martin Friebe wrote:
> Martin Waldenburg wrote:
>> Martin Friebe schrieb:
>>  
>>> It is still way faster than a person can ever type.
>>>     
>> if one does things more complicated as needed one will also
>> likely introduce more bugs.
>> A few minutes more thinking often saves hours of work,
>> in my experience.
>>
>> Martin
>>   
> You seem to have misread me. There is a diff between "doing things 
> more complicated than needed" and "adding more complex functionality 
> than previous present".
> (I don't want to go down the road and start arguing which 
> functionality is needed or useful, or ....)
>
> The fact is, that I choose an implementation that was simpler (in 
> design and implementation), so it had a lower risk of being buggy, and 
> was quicker to implement. But the reason was not that it was simpler 
> to do, the reason was that the propper solution will become easier, 
> once some of the refactoring (next sentence) has been done.
>
> It goes against the good principle of "do it right or not at all". But 
> SynEdit as it stands for now, has become so far a way from good 
> design, that it will take a long time to change this (I am in the 
> process of trying). I simply decided, that this should not stop me 
> from also adding features.
>
Slightly different answer:

I do not only spent minutes, but probably even hours on thinking. Yet I 
am aware that I can never explore all tought alone. I can not even 
explore a sufficient percentage of the available thought as long as I do 
this on my own.
Hence I will always read, and think about any constructive critic.

As for the issue at hand, here are my thought (up till now), and feel 
free to add any input, which may improve them.

Currently FoldInfo (referring to available FoldPositions) is stored on 
the ranges. (I do not know who introduced it, or if it was right at the 
time, nor does it make sense for me now, to try and judge this). If 
carefully done FoldInfo could be stored outside the Ranges (on an AVL 
tree similar to the one that stores which folds are collapsed). The 
highlighter may still be an appropriate place to detect them, Since it 
does already do some scanning. (Yet that is an isue of it's own, 
deserving it's own thoughts)

- This could reduce the amount of different Ranges, and therefore reduce 
the likelihood of having to Scan many lines before getting in Sync with 
existing ranges.
- this would also allow for separate FoldTrees for pascal begin/end; for 
{$SECTION} user defined (which can overlap); for {$IFDEF}

This hasn't been started yet. I am still thinking about it.

Best Regards
Martin







More information about the Lazarus mailing list