Method: WCC::Differ#compute_hilite
- Defined in:
- lib/wcc/diff.rb
#compute_hilite ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/wcc/diff.rb', line 107 def compute_hilite # get representional string for the whole diff s = rchar #puts s mds = [] md = s.match(/(@|_)di(@|_)/) while not md.nil? mds << md s = s.substring(md.begin(2)) md = s.match(/(@|_)di(@|_)/) end offset = 0 mds.each do |md| i = offset+md.begin(1)+1 offset = md.begin(2)+1 # found a single insertion/deletion pair InLineDiffer.new(@di[i], @di[i+1]).compute_hilite end end |