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
Jérome Perrin
gitlab-ce
Commits
4be80f8a
Commit
4be80f8a
authored
Jan 27, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix highlighting in blame view.
parent
a93f7099
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/blame_controller.rb
app/controllers/projects/blame_controller.rb
+4
-0
app/views/projects/blame/show.html.haml
app/views/projects/blame/show.html.haml
+2
-4
No files found.
CHANGELOG
View file @
4be80f8a
...
@@ -20,6 +20,7 @@ v 8.4.2 (unreleased)
...
@@ -20,6 +20,7 @@ v 8.4.2 (unreleased)
improvement when checking if a repository was empty
improvement when checking if a repository was empty
- Add instrumentation for Gitlab::Git::Repository instance methods so we can
- Add instrumentation for Gitlab::Git::Repository instance methods so we can
track them in Performance Monitoring.
track them in Performance Monitoring.
- Fix highlighting in blame view.
v 8.4.2 (unreleased)
v 8.4.2 (unreleased)
- Fix method undefined when using external commit status in builds
- Fix method undefined when using external commit status in builds
...
...
app/controllers/projects/blame_controller.rb
View file @
4be80f8a
...
@@ -18,7 +18,10 @@ class Projects::BlameController < Projects::ApplicationController
...
@@ -18,7 +18,10 @@ class Projects::BlameController < Projects::ApplicationController
groups
=
[]
groups
=
[]
current_group
=
nil
current_group
=
nil
highlighted_lines
=
Gitlab
::
Highlight
.
highlight
(
@blob
.
name
,
@blob
.
data
).
lines
i
=
0
blame
.
each
do
|
commit
,
line
|
blame
.
each
do
|
commit
,
line
|
line
=
highlighted_lines
[
i
].
html_safe
if
prev_sha
&&
prev_sha
==
commit
.
sha
if
prev_sha
&&
prev_sha
==
commit
.
sha
current_group
[
:lines
]
<<
line
current_group
[
:lines
]
<<
line
else
else
...
@@ -27,6 +30,7 @@ class Projects::BlameController < Projects::ApplicationController
...
@@ -27,6 +30,7 @@ class Projects::BlameController < Projects::ApplicationController
end
end
prev_sha
=
commit
.
sha
prev_sha
=
commit
.
sha
i
+=
1
end
end
groups
<<
current_group
if
current_group
.
present?
groups
<<
current_group
if
current_group
.
present?
...
...
app/views/projects/blame/show.html.haml
View file @
4be80f8a
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
.file-content.blame.code.js-syntax-highlight
.file-content.blame.code.js-syntax-highlight
%table
%table
-
current_line
=
1
-
current_line
=
1
-
blame_highlighter
=
highlighter
(
@blob
.
name
,
@blob
.
data
,
nowrap:
true
)
-
@blame
.
each
do
|
blame_group
|
-
@blame
.
each
do
|
blame_group
|
%tr
%tr
%td
.blame-commit
%td
.blame-commit
...
@@ -38,8 +37,7 @@
...
@@ -38,8 +37,7 @@
\
\
-
current_line
+=
line_count
-
current_line
+=
line_count
%td
.lines
%td
.lines
%pre
{
class:
'code highlight'
}
%pre
.code.highlight
%code
%code
-
blame_group
[
:lines
].
each
do
|
line
|
-
blame_group
[
:lines
].
each
do
|
line
|
:preserve
#{
line
}
#{
blame_highlighter
.
highlight
(
line
)
}
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