Commit f6a67fbad5119e3d95e33cfd4f4e4992707d5ba0
1 parent
9afee5ad
Exists in
master
and in
4 other branches
Issue #87
Showing
1 changed file
with
10 additions
and
4 deletions
Show diff stats
app/views/commits/_text_file.html.haml
| 1 | +- line_old = 0 | |
| 2 | +- line_new = 0 | |
| 1 | 3 | - lines_arr = diff.diff.lines.to_a |
| 2 | -- line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0 | |
| 3 | -- line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0 | |
| 4 | -- lines = lines_arr[3..-1].join | |
| 5 | -- lines.each_line do |line| | |
| 4 | +- lines_arr.each do |line| | |
| 5 | + - next if line.match(/^--- a/) | |
| 6 | + - next if line.match(/^\+\+\+ b/) | |
| 7 | + - if line.match(/^@@ -/) | |
| 8 | + - line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 | |
| 9 | + - line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0 | |
| 10 | + - next | |
| 11 | + | |
| 6 | 12 | = diff_line(line, line_new, line_old) |
| 7 | 13 | - if line[0] == "+" |
| 8 | 14 | - line_new += 1 | ... | ... |