gyscos / gyscos/cursive

[BUG]Display misplacement when text content contains zero-width characters

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

Description

**Describe the bug**
I created a simple example where the text contains \u{0E34} characters and it behaves differently in the two terminals.
The output of the unicode-width crate shows that \u{0E34} is a zero-width character, and Windows Terminal treats it as a separate character, while Fluent Terminal tries to combine it with the latter character.
In my environment, each line has 168 characters.
In the output of Fluent Terminal, there is a dislocation at the end of the first line of the window, and the "A" character at the end of the second line wraps before filling the space.

**To Reproduce**
Please run this code on Windows Terminal or Fluent Terminal:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1ecccfc37c0d58913221999ad700c8b8

**Expected behavior**
I expect no misalignment in both terminals and characters fill the remaining space.

**Screenshots**
Windows Terminal:
![image](https://user-images.githubusercontent.com/25812821/192736733-3111c254-9960-40d8-9edc-c6dc580d5730.png)

Fluent Terminal:
![image](https://user-images.githubusercontent.com/25812821/192736796-afd23f99-bee1-4b79-bd5e-f24a0e1d5730.png)

**Environment**
* Operating system: Windows 11
* Backend used: crossterm
* Cursive version: crates.io (0.20.0)

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.