Document nested sliders case in manual

pull/353/head
Wilfred Hughes 2022-09-05 15:06:10 +07:00
parent 9695d0009e
commit 7422cb8f2e
1 changed files with 18 additions and 1 deletions

@ -129,7 +129,7 @@ We want to consider both `foo` and `bar` to be unchanged. This case is
challenging for diffing algorithms that do a bottom-up then top-down
matching of trees.
## Sliders
## Sliders (Flat)
Sliders are a common problem in text based diffs, where lines are
matched in a confusing way.
@ -165,6 +165,23 @@ Ideally we'd prefer marking contiguous nodes as novel, so we highlight
longest-common-subsequence algorithm, these two choices are
equivalent.
## Sliders (Nested)
```
// Before
old1(old2)
// After
old1(new1(old2))
```
Should this be <code>old1(<span style="background-color: PaleGreen">new1(</span>old2<span style="background-color: PaleGreen">)</span>)</code> or
<code>old1<span style="background-color: PaleGreen">(new1</span>(old2)<span style="background-color: PaleGreen">)</span></code>?
The correct answer depends on the language. Most languages want to
prefer the inner delimiter, whereas Lisps and JSON prefer the outer
delimiter.
## Minimising Depth Changes
```