[Lazarus] Auto indentation

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Nov 5 18:05:28 CET 2009


On Thu, 05 Nov 2009 17:46:25 +0100
Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:

> > And that's kind of formatting that I don't like. My formatter would 
> > append dangling begins to the end of the preceding part of the 
> > statement. This is where the language syntax comes into play:
> > Pascal:
> > if a then BEGIN
> >   ...
> > END else BEGIN
> >   ...
> > END
> 
> And that's something *I* don't like. You never know which END belongs
> to wheach BEGIN. I always column align all ENDs to their
> corresponding BEGINs. That makes it much easier to check if some of
> these keywords are missing:
> 
> if a then
>     begin
>     xxxxx
>     .....
>     yyyyy
>     zzzzz
>     end;
> 
> To me BEGIN and END clamp a logical block (that is indented by 3 
> characters) so they need to be aligned with all commands of the same 
> level. Each next block of IF, WHILE, REPEAT etc. is indented again by
> 3 characters. By following this strict rule the code is much more
> readable to me.

I disagree, but the new auto indenter supports this too. And as
already said: you don't even need to set an option. It works
automatically.
With the new synedit OnPaste event I will try to fix the indent on
paste.


Mattias




More information about the Lazarus mailing list