[Lazarus] clarification / Re: constant-highlight ? [Re: quick opinion poll / pascal highlighting "case"]

Graeme Geldenhuys graemeg.lists at gmail.com
Fri May 28 09:15:19 CEST 2010


On 27 May 2010 21:25, waldo kitty wrote:
>> if x then begin
>>   code
>> end else begin
>>   if y then begin
>>     code
>>   end else begin
>>     code
>>   end;
>> end;
>>
>
> the above format hurts my eyes... i cannot see else, for one thing, and
> cannot separate out the individual code blocks...


This is why I somethings think C (mostly unix projects) or Java have
some reason behind there madness. They often use Tab character for
indentation and set it equal to 8 spaces. 8 is a bit much I think, but
it is much easier to see indentation that 2 spaces. Maybe 4 spaces is
a good middle ground.

If only Elastic Tabstops was implemented in Lazarus IDE, then
everybody (I say that with a pinch of salt) should be happy as you can
easily configure your own personal indentation widths, and will *not*
affect other's indentation preferences. Elastic Tabstops always uses
the least amount of tabs - normally one or two only, but widths of
tabs are automatically calculated per code block.

In the mean time, I have already considered switch all my pascal code
to using Tab characters. That way each developer can specify what
indentation width they want, but this is rather difficult to do in
Lazarus. Why? Because tab width (editor preference) is a global
option, not per project, so it will affect all other projects too,
which is not ideal. And standard usage of Tab characters are not
really as good as Elastic Tabstops.

  nickgravgaard.com/elastictabstops/
There is a Java applet you can play with and see how indentation
works. But read the theory first to understand what it does. It's
pretty clever!

PS:
I have tried once to implement Elastic Tabstops in Lazarus IDE, but
SynEdit was just too confusing for me. And this was before Martin's
major SynEdit refactoring and IFDEF code cleanup. Maybe SynEdit is
easier to use now - I don't know.

-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the Lazarus mailing list