Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faketerm.Diff doesn't seem to correctly handle partial cells #200

Open
mum4k opened this issue May 4, 2019 · 0 comments
Open

faketerm.Diff doesn't seem to correctly handle partial cells #200

mum4k opened this issue May 4, 2019 · 0 comments
Labels
cleanup Something isn't as good as it could be.

Comments

@mum4k
Copy link
Owner

mum4k commented May 4, 2019

This only has impact on the readability of test outputs.

Partial cells are cells in the buffer that should not contain a rune, because the previous cell contains a full-width unicode rune. Full-width unicode runes that two cells when printed on the terminal.

The partial cell is printed out even though it should be skipped:

               got:
                    │         ⢀⠎
                    │        ⡠⠃
                    │       ⡔⠁
            世^@世^@世^@世^@│     ⢀⠎
                    │    ⡰⠁
                    │  ⢀⠜
                    │ ⢠⠊
                 abc│⡰⠁
                    └───────────
                     0         1

The bug seems to be here, we print out the rune even if it is is partial:

} else if r == 0 && !partial {
r = ' '
}
b.WriteRune(r)

And here:

if r == 0 && !partial {
r = ' '
}
b.WriteRune(r)

@mum4k mum4k added the cleanup Something isn't as good as it could be. label May 4, 2019
@mum4k mum4k added this to the Release 0.10.0 milestone May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Something isn't as good as it could be.
Projects
None yet
Development

No branches or pull requests

1 participant