[Lazarus] smart tabs but 2 spaces tab width

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jul 22 00:33:24 CEST 2008


On Sat, 19 Jul 2008 06:01:43 +0200
Marc Santhoff <M.Santhoff at t-online.de> wrote:

> Hi,
> 
> I'm not really happy with lazarus' tab indentation feature.
> 
> When the next line has an indentation wider than standard tab width,
> which is set to 2 spaces in my case, the cursor jumps to the (delphi
> like IIRC) next position aligned under the next space in the previous
> line (me thinks ;).
> 
> I want to have smart tabs on, because I don't need to hit tab several
> times for deep indentations, but the stop should be only 2 places more
> than the start of the word in the previous line above ... difficult to
> explain.
> 
> Look here, if I have this:
> 
> case ButtonType of
>     nbFirst:  lb.ItemIndex := 0;
>     nbLast:   begin
> 
> and want to write that:
> 
>   case ButtonType of
>     nbFirst:  begin
>                 lb.ItemIndex := 0;
>                 ...
>               end;
>     nbLast:   begin
> 
> When hitting enter with the cursor before "lb.itemIndex" it is
> indented to align with "nbFirst". If I hit TAB with smart tabs off I
> have to do that a couple of times - too often.
> 
> If I do the same with smart tabs on, the first TAB aligns with the
> colon after "nbFirst", the second aligns one char after the "of" two
> lines above (the "case" line). This second TAB should align two
> spaces wide, not to any end of word.
> 
> Can someone follow me?

Yes. Smart tabs jumps to next word start of previous lines.

> Is this behaviour possible with any combination of editor settings?

No. That's why they are called 'smart'.

Mattias



More information about the Lazarus mailing list