diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-01-27 18:15:24 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-01-27 18:15:24 +0300 |
commit | 4be80f8aa3c585882b4499d6d69dcbf4a97eff29 (patch) | |
tree | 2bb212f39637ba5124897917d43650cda233b67c /app/controllers/projects/blame_controller.rb | |
parent | a93f7099fa2ed98746ebfb5e55322d0afb5068f8 (diff) |
Fix highlighting in blame view.
Diffstat (limited to 'app/controllers/projects/blame_controller.rb')
-rw-r--r-- | app/controllers/projects/blame_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb index 9ea518e6c85..d2aee3879e9 100644 --- a/app/controllers/projects/blame_controller.rb +++ b/app/controllers/projects/blame_controller.rb @@ -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? |