[Lazarus] LineRange [Re: Auto indentation]

Mattias Gärtner nc-gaertnma at netcologne.de
Tue Nov 3 18:19:27 CET 2009


Zitat von Martin <lazarus at mfriebe.de>:

> Mattias,
>
> have you looked at using
>  StartLine := Min(Old:ogCaret.Y, LogCaret.Y);
>  EndLine := Max(Old:ogCaret.Y, LogCaret.Y);

Sometimes synedit gives me too many lines, sometimes not enough. I  
need the real insert range.


> That would also have the advantage that an "end" would be unindented  
> correctly. e.g typing
>
> if a > 1 then begin
>  b:= 1; // the indenter has added 2 spaces => correct
>  end;|
>
> now hit return at "|".
> The line with the end in it does not change, so it is not in the  
> range. But it is in the caret range. And it should be unindented

Correcting the leaving line is a todo and planned from the beginning.
Another one is a better indenting for breaking long expressions/statements.
But first I want to find a better solution for the indent on paste.

Mattias






More information about the Lazarus mailing list