Skip to content

Conversation

jfcherng
Copy link
Owner

@jfcherng jfcherng commented Mar 29, 2020

Bug Description

If we have a diffed circumstance like the following,

old: ... a-<del>B</del>-<del>C</del> ...
new: ... a-<ins>b</ins>- ...

we want to glue them into

old: ... a-<del>B-C</del> ...
new: ... a-<ins>b-</ins> ...

But instead, because of this bug, we have incorrect

old: ... a-<del>B-C</del> ...
new: ... a-<ins>b</ins>- ...

Fix

We can fix this by adding some dummy closures before glueing like

old: ... a-<del>B</del>-<del>C</del> ...
new: ... a-<ins>b</ins>-<ins></ins> ...
                        ^^^^^^^^^^^ dummy closure

so that now "old" and "new" have the same amounts of closures.

Reproducer

Use word-level and Combined renderer to test.

If we have a diffed circumstance like the following,

old: ... a-<del>B</del>-<del>C</del> ...
new: ... a-<ins>b</ins>- ...

we want to glue them into

old: ... a-<del>B-C</del> ...
new: ... a-<ins>b-</ins> ...

But instead, because of this bug, we have incorrect

old: ... a-<del>B-C</del> ...
new: ... a-<ins>b</ins>- ...

We can fix this by adding some dummy closures before glueing like

old: ... a-<del>B</del>-<del>C</del> ...
new: ... a-<ins>b</ins>-<ins></ins> ...
                        ^^^^^^^^^^^ dummy closure

so that now "old" and "new" have the same amounts of closures.

#25

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
@jfcherng jfcherng merged commit 7ddbb79 into v6 Mar 29, 2020
@jfcherng jfcherng deleted the fix-wordGlues branch March 29, 2020 16:39
@jfcherng jfcherng added the bug Something isn't working label Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant