Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-02-04 02:03:05 +0300
committerJacob Schatz <jschatz@gitlab.com>2017-02-04 02:03:05 +0300
commitaa9e77b7ce5a1ceeff6188e5d12e5fcb2589d2f1 (patch)
tree2f324f6ab2493dbbf92904547bbd852220c27752 /app/views/projects/diffs/_parallel_view.html.haml
parent575aea54e4ab83c93cd69413479372815cd287c5 (diff)
parentece2e80bf88c594b454d8dce9d040f99725ef535 (diff)
Merge branch '26300-line-numbers-are-off-in-dynamically-loaded-diff-chunks' into 'master'
Resolve "Line numbers are off in dynamically loaded diff chunks" Closes #26300 See merge request !8428
Diffstat (limited to 'app/views/projects/diffs/_parallel_view.html.haml')
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
index 98d78af2e45..074f1f634ae 100644
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -1,11 +1,9 @@
/ Side-by-side diff view
.text-file.diff-wrap-lines.code.js-syntax-highlight{ data: diff_view_data }
%table
- - last_line = 0
- diff_file.parallel_diff_lines.each do |line|
- left = line[:left]
- right = line[:right]
- - last_line = right.new_pos if right
%tr.line_holder.parallel
- if left
- case left.type
@@ -45,5 +43,7 @@
- discussion_left, discussion_right = parallel_diff_discussions(left, right, diff_file)
- if discussion_left || discussion_right
= render "discussions/parallel_diff_discussion", discussion_left: discussion_left, discussion_right: discussion_right
- - if !diff_file.new_file && last_line > 0
- = diff_match_line last_line, last_line, bottom: true, view: :parallel
+ - if !diff_file.new_file && diff_file.diff_lines.any?
+ - last_line = diff_file.diff_lines.last
+ %tr.line_holder.parallel
+ = diff_match_line last_line.old_pos, last_line.new_pos, bottom: true, view: :parallel