diff options
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 3 | ||||
-rw-r--r-- | lib/unfold_form.rb | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 77672e7d9fc..8146120f489 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -95,7 +95,8 @@ class Projects::BlobController < Projects::ApplicationController @form = UnfoldForm.new(params.to_unsafe_h) - @lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe) + @lines = @lines[@form.since - 1..@form.to - 1] unless @form.full? + @lines = @lines.map(&:html_safe) if @form.bottom? @match_line = '' diff --git a/lib/unfold_form.rb b/lib/unfold_form.rb index 05bb3ed7f1c..53adc3af0cd 100644 --- a/lib/unfold_form.rb +++ b/lib/unfold_form.rb @@ -9,6 +9,7 @@ class UnfoldForm attribute :to, GtOneCoercion attribute :bottom, Boolean attribute :unfold, Boolean, default: true + attribute :full, Boolean, default: false attribute :offset, Integer attribute :indent, Integer, default: 0 end |