Commit 721b7573 authored by Marin Jankovski's avatar Marin Jankovski

Take the next type into consideration

parent dc7554d0
......@@ -25,8 +25,8 @@ module CommitsHelper
def side_diff_line(diff, index)
Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path)
.each do |full_line, type, line_code, line_new, line_old, raw_line, next_line|
yield(full_line, type, line_code, line_new, line_old, raw_line, next_line)
.each do |full_line, type, line_code, line_new, line_old, raw_line, next_type, next_line|
yield(full_line, type, line_code, line_new, line_old, raw_line, next_type, next_line)
end
end
......
/ Side-by-side diff view
%div.text-file
%table
- side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_line|
- side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_type, next_line|
%tr.line_holder.parallel{ id: line_code }
- if type == "match"
= render "projects/commits/diffs/match_line_parallel", {line: line,
......@@ -25,7 +25,8 @@
%td.new_line{class: "#{type}", data: {linenumber: line_new}}
= link_to raw(line_new) , "##{line_code}", id: line_code
- if type == 'old'
%td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw next_line
- content = next_type == 'new' ? next_line : " "
%td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw content
- else
%td.line_content.parallel{class: "#{type}"}= raw line
......
......@@ -38,8 +38,9 @@ module Gitlab
next
else
type = identification_type(line)
next_type = identification_type(next_line)
line_code = generate_line_code(new_path, line_new, line_old)
yield(full_line, type, line_code, line_new, line_old, raw_line, next_line)
yield(full_line, type, line_code, line_new, line_old, raw_line, next_type, next_line)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment