Skip to content

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

Open

Description

@mum4k

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)

Activity

  1. added
    cleanup
    on May 4, 2019
  2. added this to the Release 0.10.0 milestone on May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanup

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions