Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TextMate toggle comment macro is broken

My laptop crashed and when it rebooted, "cmd /" (toggle comment) was broken. When I try to toggle comments on a line that only contains "foo", I get this output in my code instead of "# foo":

/tmp/temp_textmate.2erfLj:68:in /bin/bash: -c: line 0: unexpected EOF while looking for matching '' /bin/bash: -c: line 1: syntax error: unexpected end of filemap' for " foo":String (NoMethodError) from /tmp/temp_textmate.2erfLj:48:in /bin/bash: -c: line 0: unexpected EOF while looking for matching'' /bin/bash: -c: line 2: syntax error: unexpected end of file'

This is driving me nuts

like image 636
nannerpus Avatar asked Nov 29 '10 10:11

nannerpus


1 Answers

Matt Hayes' answer pointed me to the trouble spot.

Bundles -> Bundle Editor -> Edit Commands --> Source --> Comment Line / Selection

change line 139:

- lines = text.to_a
+ lines = text.split(/$/).map(&:chomp)

#to_a is no longer a string method.

http://ruby-doc.org/core-1.9.3/String.html

like image 182
20man Avatar answered Sep 20 '22 21:09

20man