mirror of https://github.com/Wilfred/difftastic/
Fix sliders in a single global pass
Previously we fixed sliders in each 'possibly changed' region. This meant that we couldn't fix sliders that needed to move outside the region. The most common case was code of the form `foo, bar, baz` where `, baz` was unchanged but we wanted to slide to `,`. We now call `fix_all_sliders` for the toplevel tree on both sides. This required some minor changes to the slider logic, as the unchanged/novel regions could occur at any level of the tree. (It was probably also the case that we were missing slider opportunities previously, because we terminated as soon as we found an outer slider for the nested case.) This change has no performance impact, probably because tree diffing is vastly more expensive (O(N^2)) than sliders (O(N)). Fixes #327add_libdifftastic 0.35.0
parent
114235e4da
commit
b104c4be10
@ -0,0 +1,5 @@
|
||||
[
|
||||
"one",
|
||||
"two",
|
||||
"three"
|
||||
]
|
||||
@ -0,0 +1,7 @@
|
||||
[
|
||||
"one",
|
||||
"novel-1",
|
||||
"two",
|
||||
"novel-2",
|
||||
"three"
|
||||
]
|
||||
Loading…
Reference in New Issue