Commit 89ab7e79 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Highlight code search results

parent 3fafac3e
...@@ -6,5 +6,4 @@ ...@@ -6,5 +6,4 @@
%strong %strong
= blob.filename = blob.filename
.file-content.code.term .file-content.code.term
%div{class: user_color_scheme_class} = render 'shared/file_hljs', blob: blob, first_line_number: blob.startline
= raw blob.colorize( formatter: :gitlab, options: { first_line_number: blob.startline } )
%div.highlighted-data{class: user_color_scheme_class} %div.highlighted-data{class: user_color_scheme_class}
.line-numbers .line-numbers
- blob.data.lines.size.times do |index| - blob.data.lines.size.times do |index|
- i = index + 1 - offset = defined?(first_line_number) ? first_line_number : 1
- i = index + offset
= link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do = link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
%i.icon-link %i.icon-link
= i = i
......
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