Sign in Join

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

Mailing lists / lazarus / 2012-11

Code auto-formatting

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Reinier Olislagers
to Krzysztof
Krzysztof wrote 6 lines
Hi, Can't find this option in Source menu. Is exists any package which format code in editor? I just updated CodeTyphon from 2.90 to 3.00. In my old project I see that code formatting is wrong in random lines (too much or too less tabs / spaces)

Source/Jedi Code Format, though I think you may need to have the JCF plugin installed. Don't know if CodeTyphon does that.

Reply by email

Krzysztof
to Reinier Olislagers

It has (but I had this package disabled). Thank you very much!

BTW:
1. Can I somehow format only selected code? JCF made changes in whole editor.
2. JCF has problem if strings have special characters (for example polish "?"). It throw strange exceptions. But this issue is easy to solve

2012/11/21 Reinier Olislagers

Show quoted text 18 lines
On 21-11-2012 13:14, Krzysztof wrote: > Hi, > > Can't find this option in Source menu. Is exists any package which > format code in editor? I just updated CodeTyphon from 2.90 to 3.00. In > my old project I see that code formatting is wrong in random lines (too > much or too less tabs / spaces) Source/Jedi Code Format, though I think you may need to have the JCF plugin installed. Don't know if CodeTyphon does that. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20121121/e639b8cf/attachment.html>

Reply by email

leledumbo
to Krzysztof
1. Can I somehow format only selected code? JCF made changes in whole

editor.

No AFAIK, it can't use partial parsing to format the code since it may lose scope information thus can cause wrong formatting.

2. JCF has problem if strings have special characters (for example polish "?"). It throw strange exceptions. But this issue is easy to solve

JCF is ported from Delphi without proper unicode support AFAIK, so there might be problems with that. You can try reporting a bug (assuming it's not fixed yet in trunk).

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Code-auto-formatting-tp4027720p4027731.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email

Krzysztof
to leledumbo
No AFAIK, it can't use partial parsing to format the code since it may

lose scope information thus can cause wrong formatting.

Right, but it is possible, for example Eclipse or Netbeans has also "Fix indent" for correcting "tab" only for selected lines. Seems that it is looking for first parent block ( { / BEGIN) so it know how to fix it. Maybe I try to post this on JFC bugtracker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20121121/aee03434/attachment.html>

Reply by email