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
On 3 Sep 2010, at 03:59, D. Grady wrote:
[...] Is this the right place to submit changes to be included in the Source repository?
Ideally fork the bundle at GitHub: http://github.com/textmate/source.tmbundle/
Then send a pull request after you have pushed your change to your fork.