You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When comparing two strings that are many lines long, the diff output should focus on the lines that are actually different, not the potentially dozens or hundreds of lines that are the same.
If the diff is longer than, say, 30 lines, divide it into sections of changes and non-changes.
If the non-change sections are 5 lines or less, merge the surrounding change sections into one larger change section.
For the sections with changes, provide 5 lines of context before and after the actual change. Take 5 lines from the preceding and succeeding non-change sections, if any. Due to step 2, these sections must be larger than 5 lines.
Prefix the change sections with a hunk heading@@ -l, +l @@, where the line numbers l correspond to the - and + sides of the diff.
Print the change sections, prefixed with their heading, and separated with an empty line between them.
The text was updated successfully, but these errors were encountered:
I'd like to work on this, where should the changes be made? I would think under StringValue.diffDeep() in lib/primitiveValues/string.js. Or is this part of StringValue.formatDeep()? It seems like there's some tests for the former in the 'diffs multiline strings' test in test/diff.ts.
See discussion: avajs/ava#2665
When comparing two strings that are many lines long, the diff output should focus on the lines that are actually different, not the potentially dozens or hundreds of lines that are the same.
@@ -l, +l @@
, where the line numbersl
correspond to the-
and+
sides of the diff.The text was updated successfully, but these errors were encountered: