Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
ece2e80b
Commit
ece2e80b
authored
Jan 18, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure linenumber data attribute is correct for the last line in a diff chunk
parent
bc0a8233
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
app/views/projects/blob/diff.html.haml
app/views/projects/blob/diff.html.haml
+1
-1
app/views/projects/diffs/_parallel_view.html.haml
app/views/projects/diffs/_parallel_view.html.haml
+3
-4
app/views/projects/diffs/_text_file.html.haml
app/views/projects/diffs/_text_file.html.haml
+3
-4
No files found.
app/views/projects/blob/diff.html.haml
View file @
ece2e80b
...
...
@@ -27,4 +27,4 @@
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
%tr
.line_holder
{
id:
@form
.
to
,
class:
line_class
}
=
diff_match_line
@form
.
to
,
@form
.
to
,
text:
@match_line
,
view:
diff_view
,
bottom:
true
=
diff_match_line
@form
.
to
-
@form
.
offset
,
@form
.
to
,
text:
@match_line
,
view:
diff_view
,
bottom:
true
app/views/projects/diffs/_parallel_view.html.haml
View file @
ece2e80b
/ 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
-
if
left
.
meta?
...
...
@@ -37,6 +35,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
-
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
,
last_line
,
bottom:
true
,
view: :parallel
=
diff_match_line
last_line
.
old_pos
,
last_line
.
new_pos
,
bottom:
true
,
view: :parallel
app/views/projects/diffs/_text_file.html.haml
View file @
ece2e80b
...
...
@@ -4,14 +4,13 @@
%a
.show-suppressed-diff.js-show-suppressed-diff
Changes suppressed. Click to show.
%table
.text-file.code.js-syntax-highlight
{
data:
diff_view_data
,
class:
too_big
?
'hide'
:
''
}
-
last_line
=
0
-
discussions
=
@grouped_diff_discussions
unless
@diff_notes_disabled
=
render
partial:
"projects/diffs/line"
,
collection:
diff_file
.
highlighted_diff_lines
,
as: :line
,
locals:
{
diff_file:
diff_file
,
discussions:
discussions
}
-
last_line
=
diff_file
.
highlighted_diff_lines
.
last
.
new_pos
-
if
!
diff_file
.
new_file
&&
last_line
>
0
-
if
!
diff_file
.
new_file
&&
diff_file
.
highlighted_diff_lines
.
any?
-
last_line
=
diff_file
.
highlighted_diff_lines
.
last
%tr
.line_holder
=
diff_match_line
last_line
,
last_line
,
bottom:
true
=
diff_match_line
last_line
.
old_pos
,
last_line
.
new_pos
,
bottom:
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment