diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-01-20 19:20:13 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-01-20 19:20:13 +0100 |
commit | 0e992a3b4e710f8486a37bfa73ad6981365fceb2 (patch) | |
tree | 210146bede4529ed861a77cd36b7b9646b9af65c /app | |
parent | 577f2fb47a7ef57415b78b49d5c746d4e99f6a98 (diff) | |
download | gitlab-ce-0e992a3b4e710f8486a37bfa73ad6981365fceb2.tar.gz |
Properly highlight lines around '\ No newline at end of file'
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/diffs/_parallel_view.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/diffs/_text_file.html.haml | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index 986d30d36a8..a15d147ab05 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -8,6 +8,11 @@ - if left[:type] == 'match' = render "projects/diffs/match_line_parallel", { line: left[:text], line_old: left[:number], line_new: right[:number] } + - elsif left[:type] == 'nonewline' + %td.old_line + %td.line_content.parallel.matched= left[:text] + %td.new_line + %td.line_content.parallel.matched= left[:text] - else %td.old_line{id: left[:line_code], class: "#{left[:type]}"} = link_to raw(left[:number]), "##{left[:line_code]}", id: left[:line_code] diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index 310bbd4efea..f4fc6caba0f 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -15,6 +15,10 @@ - if type == "match" = render "projects/diffs/match_line", {line: line.text, line_old: line_old, line_new: line.new_pos, bottom: false, new_file: diff_file.new_file} + - elsif type == 'nonewline' + %td.old_line.diff-line-num + %td.new_line.diff-line-num + %td.line_content.matched= line.text - else %td.old_line = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code |