Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

smart tabs but 2 spaces tab width

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff

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?
Is this behaviour possible with any combination of editor settings?

TIA,
Marc

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 39 lines
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

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote
On Sat, 19 Jul 2008 06:01:43 +0200 Marc Santhoff wrote:

[ ... long explanation ... ]

Show quoted text 7 lines
> 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'.

LOL

I appreciate your humor very much. It was the company formerly known as Borland who invented this feature, wasn't it? ;)

As a solution I changed my expextations of indentation style a little, I can live with that.

Thanks,
Marc

Reply by email