[TxMt] Reformat Comment command in the Source bundle

D. Grady d.c.grady at gmail.com
Fri Sep 3 01:59:21 UTC 2010

Hi, some time ago I asked a question about the Reformat Comment command from
the Source bundle and Allan kindly made some suggestions. In the interim
this command has continued to sort of not work the way I thought it should
in a few cases, and the other day I actually sat down and spent an
embarrassingly long time trying to fix it, and I was hoping someone could
give me some feedback. There were two problems that I wanted to fix:

1.) The command doesn't respect the wrap column set by the user
2.) The command sometimes adds extra whitespace where it shouldn't, for
example if you reformat
// lorem ...
// lorem...
it will add an extra space at the end of the empty line.

The first problem was pretty straightforward, and I think I corrected the
second problem as well. It looks like the problem was in the rubywrap.rb
script; a regular expression is used to identify comment lines, and this
regexp would incorrectly match the newline at the end of the empty line. I
changed it so that it only matches trailing spaces.

I've been using the modified rubywrap for a little while now and haven't
noticed any problems introduced by this change. A diff patch is attached; if
anyone has a few minutes to take a look I would appreciate it. Or if anyone
thinks this is just a non-issue, I would appreciate hearing that too. Is
this the right place to submit changes to be included in the Source
repository? Thanks in advance!

-Daniel Grady
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20100902/c5a23293/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Source.patch
Type: application/octet-stream
Size: 1500 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20100902/c5a23293/attachment.patch>

More information about the textmate mailing list