summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-01-18 16:40:34 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-18 16:40:34 -0600
commit7c583293cda3be8def5c665000a540124c838122 (patch)
tree0e0cb4d7668e16a0d53fe7c920e1818730b72014
parent270dc22658424ee7f279db99e56c6fc69acd3eb7 (diff)
downloadgitlab-ce-7c583293cda3be8def5c665000a540124c838122.tar.gz
prevent nonewline type diff lines from containing unfolding link26829-diff-unfolding-links-erroneously-present-on-no-newline-lines
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
index b087485aa17..cbd021487ef 100644
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -8,8 +8,12 @@
- last_line = right.new_pos if right
%tr.line_holder.parallel
- if left
- - if left.meta?
+ - case left.type
+ - when 'match'
= diff_match_line left.old_pos, nil, text: left.text, view: :parallel
+ - when 'nonewline'
+ %td.old_line.diff-line-num
+ %td.line_content.match= left.text
- else
- left_line_code = diff_file.line_code(left)
- left_position = diff_file.position(left)
@@ -21,8 +25,12 @@
%td.line_content.parallel
- if right
- - if right.meta?
+ - case right.type
+ - when 'match'
= diff_match_line nil, right.new_pos, text: left.text, view: :parallel
+ - when 'nonewline'
+ %td.new_line.diff-line-num
+ %td.line_content.match= right.text
- else
- right_line_code = diff_file.line_code(right)
- right_position = diff_file.position(right)