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.<br><br>Is this the right forum to post bugs in Ruby bundles?<br>
<br>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:<br><br><span style="font-family: courier new,monospace;"># xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">def func(x,y)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> x+y</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br>If you place the caret inside the comment and press control-Q you see the following:<br><br><span style="font-family: courier new,monospace;">/Applications/TextMate.app/Contents/SharedSupport/Bundles/Source.tmbundle/Support/bin/rubywrap.rb:365:in /bin/bash: +': invalid option</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Usage: /bin/bash [GNU long option] [option] ...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> /bin/bash [GNU long option] [option] script-file ...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">GNU long options:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --debug</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --dump-po-strings</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --dump-strings</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --help</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --init-file</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --login</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --noediting</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --noprofile</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --norc</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --posix</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --rcfile</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --restricted</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --verbose</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> --version</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> --wordexp</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Shell options:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -irsD or -c command or -O shopt_option (invocation only)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> -abefhkmnptuvxBCHP or -o optionwrite'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Source.tmbundle/Support/bin/rubywrap.rb:408</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">def func(x,y)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> x+y</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">This doesn't happen if the word in the comment stops before column 80.<br>
<br>This isn't an impossible scenario because it's easy to have a URL in your documentation that's more than 80 characters long.<br><br>-- <br>Bill McNeill<br><a href="http://staff.washington.edu/billmcn/index.shtml">http://staff.washington.edu/billmcn/index.shtml</a>