Sign in Join

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

Mailing lists / lazarus / 2012-09

SynEdit: AutoIndent with Tabs instead of spaces, is this possible?

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Bernd

I cannot find any way to convince SynEdit to indent the next line with a tab when I press enter on an indented line, it will always use spaces, even if eoTabsToSpaces is false and eoTabIndent is true and the previous line is intended with a Tab. Pressing Tab to indent works as expected but not the AutoIndent. I need to edit Makefile templates, they may not be indented with spaces or it will be a syntax error. The only way I have found is to disable AutoIndent completely or do a string replace after editing.

Reply by email

Martin
to Bernd
Bernd wrote 9 lines
I cannot find any way to convince SynEdit to indent the next line with a tab when I press enter on an indented line, it will always use spaces, even if eoTabsToSpaces is false and eoTabIndent is true and the previous line is intended with a Tab. Pressing Tab to indent works as expected but not the AutoIndent. I need to edit Makefile templates, they may not be indented with spaces or it will be a syntax error. The only way I have found is to disable AutoIndent completely or do a string replace after editing.

Assuming you talk about the real auto indent. Not the new codetool smart indent (that can add extra indent, after a begin)

You can select 1 of the 3
"spaces"
"space/tab" as previous line
"pos only"

press F1 the wiki describes them.

---
in short, tabs yes, IF the current line is also indented by tabs. Then the tabs of the current lines are copied

Reply by email

Bernd
to Martin

2012/9/24 Martin :

You can select 1 of the 3 "spaces" "space/tab" as previous line "pos only"

What combination of Options and Options2 do I need for that or how is the property called? I can't find it.

press F1 the wiki describes them.

"No help found for this topic" (TSynEdit)

Reply by email

Martin
to Bernd
Bernd wrote 9 lines
2012/9/24 Martin : > You can select 1 of the 3 > "spaces" > "space/tab" as previous line > "pos only" What combination of Options and Options2 do I need for that or how is the property called? I can't find it.

Oh in your own app, not in the IDE.

its in the beautifier

   TSynBeautifier = class(TSynCustomBeautifier)
   published
     property IndentType: TSynBeautifierIndentType read FIndentType
write FIndentType;

Make sure you have the correct beautifier, the default is one instance (not sure which class) for all edits.

There is a callback for indent too. so you can customize

Reply by email

Bernd
to Martin

2012/9/24 Martin :

Show quoted text 9 lines
its in the beautifier TSynBeautifier = class(TSynCustomBeautifier) published property IndentType: TSynBeautifierIndentType read FIndentType write FIndentType; Make sure you have the correct beautifier, the default is one instance (not sure which class) for all edits.

Ok, assigned it a newly created beautifier, set its properties appropriately and now it works as expected.

Thank you.

Reply by email