gyscos / gyscos/cursive

Displaying layers on top of wide characters can cause issues

Open
#100 1 comment 0 reactions 0 assignees View on GitHub
bug compat_nonascii internals
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

When a layer is drawn on top of another layer, if this lower layer contains wide characters, bad things may happen.
In general, if we overwrite only one of the two columns of a wide character, the entire character is replaced.
This means everything to the right will be offset by 1 column to the left.
This is visible in the `lorem` example, if the popup window is above the Japanese text.

Not sure how to solve this... Every time we write on top of a wide character, if we're only overwriting half of it, we need to add a space before or after.
This requires knowing what's under the layer being drawn, which is not possible currently.
Instead of keeping a copy of the entire screen, we could just keep a grid of the wide characters present. Though this does mean parsing every string being printed... Doh :(

`nmtui` seems to be doing fine, it indeed replaces wide characters with space.

Note: be careful to keep the style of the wide character.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.