Sign in Join

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

Mailing lists / lazarus / 2015-11

code format selection only

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Rik van Kekem
to Graeme Geldenhuys
Graeme Geldenhuys wrote
As far as I understand the code formatter included with Lazarus is the Jedi Code Formatter. Does anybody know if it supports formatting only a selection (eg: the body of a method) - or does it always require whole unit formatting?

As far as I could see in the source the Jedi Code Formatter takes the complete source-file (from the editor). I also noticed it's kinda fussy about incomplete code. It will not reformat incorrect code. De Code Formatter in Delphi CAN format incomplete code. So formatting a part of source-code would be difficult because it's incomplete. You can also see this if you only copy your intended method to an empty unit and try formatting it. It will not work.

In the past I looked for an option to disable JCF for part of the source-code but I couldn't find anything. That would be more useful to me than formatting part of the code. Sometimes you don't follow "the rules" on purpose because it's more clear but the JCF mangles it up. Disabling JCF for just that part would be useful.

Grtz,
Rik (rvk)

Reply by email