Sign in Join

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

Mailing lists / lazarus / 2010-04

Code Templates - Sync Edit - Add'l Tokens

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Lee Jenkins

Current there is the "|" to indicate within a code template where the cursor should be left after execution.

Are there any other token that can be used? Specifically, I'm looking for something that will denote a tab/indent so that indentation can be performed inside the code template based on the Lazarus user's settings for tab-to-spaces, etc.

for $Param(CounterVar) := $Param(0) to $Param(Count) - 1 do
   begin
     |
   end;

In essence, a way to position tokens like Begin...End with an indent according to user's IDE preferences.

P.S. I'm converting many of the code templates shipped with Lazarus to work with sync editing where appropriate such as the above example. Should I submit these when I am finished?

Thanks,

Warm Regards, Lee

Reply by email

Mattias Gaertner
to Lee Jenkins
Show quoted text 15 lines
Current there is the "|" to indicate within a code template where the cursor should be left after execution. Are there any other token that can be used? Specifically, I'm looking for something that will denote a tab/indent so that indentation can be performed inside the code template based on the Lazarus user's settings for tab-to-spaces, etc. for $Param(CounterVar) := $Param(0) to $Param(Count) - 1 do begin | end; In essence, a way to position tokens like Begin...End with an indent according to user's IDE preferences.

Not yet.
You could write a macro to use the jcf or prettyformat.

P.S. I'm converting many of the code templates shipped with Lazarus to work with sync editing where appropriate such as the above example. Should I submit these when I am finished?

Of course. :)

Mattias

Reply by email