[SVN] Source bundle, comment line command: Changes for Ruby 1.9

Charles Turner vze26m98 at optonline.net
Thu Aug 28 18:20:17 UTC 2008


This diff file shows the patches I made to get the Source bundle 
command file 
Comment Line : Selection to work with ruby 1.9.0 (2007-12-25 revision 
14709) 
[i686-darwin9.4.0]

I made no attempt to write code that works for another Ruby version. 
Zip of the diff attached below.

-Charles


--- /Users/cturner/Desktop/Comment Line : Selection.tmDelta
+++ Toggle comment.plist
@@ -72,7 +72,7 @@
   case com[:mode]
   when "line"  # line by line comment
     if text !~ /\A[\t ]+\z/ &&
-       text.lines.map { |l| !!(l =~ /\A\s*(#{com[:esc_start]}|$)/) 
}.uniq == [true]
+       text.map { |l| !!(l =~ /\A\s*(#{com[:esc_start]}|$)/) }.uniq == 
[true]
       if $selected
         out text.gsub( 
/^(\s*)#{com[:esc_start]}(.*?)#{com[:esc_end]}(\s*)$/,
                        '\1\2\3' )
@@ -122,7 +122,7 @@
   else
     indent = text.scan(/^[\t \0]*(?=\S)/).
                   min { |a, b| a.length <=> b.length } || ""
-    text.lines.map do |line|
+    text.map do |line|
       if line =~ /^(#{indent})(.*)$(\n?)/ then
         out $1 + default[:start] + $2 + default[:end] + $3
       elsif line =~ /^(.*)$(\n?)/ then
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Source-Toggle comment.diff.zip
Type: application/zip
Size: 1039 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20080828/599d5562/attachment.zip>


More information about the textmate-dev mailing list