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
iv
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
Hide 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)
improvement when checking if a repository was empty
- Add instrumentation for Gitlab::Git::Repository instance methods so we can
track them in Performance Monitoring.
- Fix highlighting in blame view.
v 8.4.2 (unreleased)
- 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
groups
=
[]
current_group
=
nil
highlighted_lines
=
Gitlab
::
Highlight
.
highlight
(
@blob
.
name
,
@blob
.
data
).
lines
i
=
0
blame
.
each
do
|
commit
,
line
|
line
=
highlighted_lines
[
i
].
html_safe
if
prev_sha
&&
prev_sha
==
commit
.
sha
current_group
[
:lines
]
<<
line
else
...
...
@@ -27,6 +30,7 @@ class Projects::BlameController < Projects::ApplicationController
end
prev_sha
=
commit
.
sha
i
+=
1
end
groups
<<
current_group
if
current_group
.
present?
...
...
app/views/projects/blame/show.html.haml
View file @
4be80f8a
...
...
@@ -15,7 +15,6 @@
.file-content.blame.code.js-syntax-highlight
%table
-
current_line
=
1
-
blame_highlighter
=
highlighter
(
@blob
.
name
,
@blob
.
data
,
nowrap:
true
)
-
@blame
.
each
do
|
blame_group
|
%tr
%td
.blame-commit
...
...
@@ -38,8 +37,7 @@
\
-
current_line
+=
line_count
%td
.lines
%pre
{
class:
'code highlight'
}
%pre
.code.highlight
%code
-
blame_group
[
:lines
].
each
do
|
line
|
:preserve
#{
blame_highlighter
.
highlight
(
line
)
}
#{
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