Changeset 3054

Show
Ignore:
Timestamp:
12/11/07 20:33:23 (6 years ago)
Author:
znz
Message:

usageとunderlineを戻すエスケープシーケンスを追加

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/misc/diffcolor.rb

    r2951 r3054  
    44colorize diff like vim. 
    55and show \r and other space characters. 
     6 
     7== usage 
     8  env LANG=C svn diff | diffcolor.rb | lv -c 
     9  svk diff | diffcolor.rb | less -R 
    610 
    711== License 
     
    4246  end 
    4347  print "\e[#{color}m" 
    44   line.gsub!(/\r/) { "\e[34m\\r" } 
    45   line.gsub!(/[^\n\S]+/) { "\e[34;4m#{$&}\e[#{color}m" } 
     48  line.gsub!(/\r/) { "\e[34;4m\\r\e[0m" } 
     49  line.gsub!(/[^\n\S]+/) { "\e[34;4m#{$&}\e[0;#{color}m" } 
    4650  puts line 
    4751end