I've found a bug in the Ruby bundle for Textmate. Under certain circumstances, using Control-Q to reformat comment code raises an exception that spews error code into the source.
Is this the right forum to post bugs in Ruby bundles?
The problem occurs if you have a comment that contains a single word that goes past column 79. For example, in the following code (also attached) the x's in the comment extend out to column 80:
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx def func(x,y) x+y end
If you place the caret inside the comment and press control-Q you see the following:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/Source.tmbundle/Support/bin/rubywrap.rb:365:in /bin/bash: +': invalid option Usage: /bin/bash [GNU long option] [option] ... /bin/bash [GNU long option] [option] script-file ... GNU long options: --debug --dump-po-strings --dump-strings --help --init-file --login --noediting --noprofile --norc --posix --rcfile --restricted --verbose --version --wordexp Shell options: -irsD or -c command or -O shopt_option (invocation only) -abefhkmnptuvxBCHP or -o optionwrite' from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Source.tmbundle/Support/bin/rubywrap.rb:408 def func(x,y) x+y end
This doesn't happen if the word in the comment stops before column 80.
This isn't an impossible scenario because it's easy to have a URL in your documentation that's more than 80 characters long.
On Mar 25, 2008, at 1:22 PM, Bill McNeill wrote:
I've found a bug in the Ruby bundle for Textmate. Under certain circumstances, using Control-Q to reformat comment code raises an exception that spews error code into the source.
Actually that command, Reformat Comment, is in the Source bundle.
Is this the right forum to post bugs in Ruby bundles?
Sure, this is a fine place.
The problem occurs if you have a comment that contains a single word that goes past column 79. For example, in the following code (also attached) the x's in the comment extend out to column 80:
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx def func(x,y) x+y end
I can duplicate the error here, so I'll look into it as I have some time.
Thanks for letting us know.
James Edward Gray II
On Mar 25, 2008, at 1:36 PM, James Gray wrote:
On Mar 25, 2008, at 1:22 PM, Bill McNeill wrote:
The problem occurs if you have a comment that contains a single word that goes past column 79. For example, in the following code (also attached) the x's in the comment extend out to column 80:
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx def func(x,y) x+y end
I can duplicate the error here, so I'll look into it as I have some time.
This is a bug in the rubywrap.rb script that is bundled with TextMate. I believe I've located the issue and I've committed what I hope is a fix into the Subversion repository.
James Edward Gray II