samg / diffy

Easy Diffing in Ruby
http://rubygems.org/gems/diffy
MIT License
1.26k stars 103 forks source link

Showing "..." instead of simply skipping lines with context #104

Open rahul-cloud66 opened 5 years ago

rahul-cloud66 commented 5 years ago

I am comparing to txt files with a context of just 50 lines and like how github's display compares file, I wanted to show "..." when skipping intermediate lines that are not showed by context (the set of lines that are same in both files) Anyway to generate them whilst still rendering diff in html?

@diff = Diffy::Diff.new(report_1_txt,report_2_txt,:include_plus_and_minus_in_html => true, :context=>50).to_s(:html)

Trying .each_chunk.to_adoesn't help either because at the end diff has to be rendered in html