diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-07 00:21:29 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-06-08 17:39:54 +0300 |
commit | e6e29f9220a676f86ad035ae6430888deab4e8c5 (patch) | |
tree | 3f8ae7e10fcc6175d1046cee9c719f81c29998a5 /app/controllers | |
parent | 1bc80c2587323b9107ec3fb2fe6024d7e7817e35 (diff) |
Use Diff::File blob methods from diff highlighter
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 4f53929a308..d8d14ea1fed 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -93,9 +93,11 @@ class Projects::BlobController < Projects::ApplicationController def diff apply_diff_view_cookie! - @form = UnfoldForm.new(params) - @lines = Gitlab::Highlight.highlight_lines(repository, @ref, @path) - @lines = @lines[@form.since - 1..@form.to - 1] + @blob.load_all_data! + @lines = Gitlab::Highlight.highlight(@blob.path, @blob.data, repository: @repository).lines + + @form = UnfoldForm.new(params) + @lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe) if @form.bottom? @match_line = '' |