@ -15,7 +15,7 @@ x
(x)
```
Desired result: < code > <span style = "background-color: PaleGreen "> (< /span > x< span style = "background-color: PaleGreen "> )< / span > < /code >
Desired result: < code ><span style = "background-color: PaleGreen ; color: #000 " > (< /span > x< span style = "background-color: PaleGreen ; color: #000 " > )</ span >< /code >
This is tricky because `x` has changed its depth in the tree, but `x`
itself is unchanged.
@ -48,7 +48,7 @@ than the `x`.
(x y)
```
Desired output: < code >(x < span style = "background-color: PaleGreen "> y< /span > )< /code >
Desired output: < code >(x < span style = "background-color: PaleGreen ; color: #000 "> y< /span > )< /code >
In this case, we want to highlight `y` . Highlighting the delimiters
could make `x` look changed.
@ -75,10 +75,10 @@ This should be highlighted similar to the expanding delimiter case.
(foo (novel) (bar))
```
Desired result: < code >(foo < span style = "background-color:PaleGreen " >(novel)< /span > (bar)< /code >
Desired result: < code >(foo < span style = "background-color:PaleGreen ; color: #000 " >(novel)< /span > (bar)< /code >
It is easy to end up with
< code >(foo (< span style = "background-color:PaleGreen "> novel< /span > ) < span style = "background-color:PaleGreen "> (< /span > bar< span style = "background-color:PaleGreen "> )< /span > )< /code > ,
< code >(foo (< span style = "background-color:PaleGreen ; color: #000 " > novel< /span > ) < span style = "background-color:PaleGreen ; color: #000 " > (< /span > bar< span style = "background-color:PaleGreen ; color: #000 "> )< /span > )< /code > ,
where a later pair of delimiters are chosen.
## Rewrapping Large Nodes
@ -109,7 +109,7 @@ minimal diff.
(y x)
```
Desired result: < code >(< span style = "background-color: PaleGreen "> y< /span > < span style = "background-color: PaleGreen "> x< /span > )< /code >
Desired result: < code >(< span style = "background-color: PaleGreen ; color: #000 " > y< /span > < span style = "background-color: PaleGreen ; color: #000 "> x< /span > )< /code >
We want to highlight the list contents and not the delimiters.
@ -123,7 +123,7 @@ foo(bar(123))
foo(extra(bar(123)))
```
Desired result: < code >foo(< span style = "background-color: PaleGreen "> extra(< /span > bar(123)< span style = "background-color: PaleGreen "> )< /span > )< /code >
Desired result: < code >foo(< span style = "background-color: PaleGreen ; color: #000 " > extra(< /span > bar(123)< span style = "background-color: PaleGreen ; color: #000 "> )< /span > )< /code >
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
@ -175,8 +175,8 @@ old1(old2)
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 > ?
Should this be < code >old1(< span style = "background-color: PaleGreen ; color: #000 " > new1(< /span > old2< span style = "background-color: PaleGreen ; color: #000 "> )< /span > )< /code > or
< code >old1< span style = "background-color: PaleGreen ; color: #000 " > (new1< /span > (old2)< span style = "background-color: PaleGreen ; color: #000 " > )</ span >< /code > ?
The correct answer depends on the language. Most languages want to
prefer the inner delimiter, whereas Lisps and JSON prefer the outer