Commit 10cf933f authored by Sean McGivern's avatar Sean McGivern Committed by Fatih Acet

Highlight files based on merged file

parent 66ffa28e
...@@ -59,8 +59,11 @@ module Gitlab ...@@ -59,8 +59,11 @@ module Gitlab
end end
def highlight_lines! def highlight_lines!
their_highlight = Gitlab::Highlight.highlight_lines(repository, their_ref, their_path) their_file = lines.reject { |line| line.type == 'new' }.map(&:text).join("\n")
our_highlight = Gitlab::Highlight.highlight_lines(repository, our_ref, our_path) our_file = lines.reject { |line| line.type == 'old' }.map(&:text).join("\n")
their_highlight = Gitlab::Highlight.highlight(their_path, their_file, repository: repository).lines.map(&:html_safe)
our_highlight = Gitlab::Highlight.highlight(our_path, our_file, repository: repository).lines.map(&:html_safe)
lines.each do |line| lines.each do |line|
if line.type == 'old' if line.type == 'old'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment