Commit 5e9b2e3
authored
Merge pull request #428 from migueldeicaza/wcspec
For a while, we had a bit of a hodgepodge of attempts to measuring characters
properly. And I discovered ucs-detect [1] along with a spec for how terminal
emulators should measure unicode [2].
This patch implements that behavior.
Unicode width now comes from UCD properties + EastAsianWidth W/F ranges and
valid emoji‑variation sequences, and printing/combining now respects width ‑1/0
and only widens on valid VS16 (witha spacer cell) while dropping invalid
zero‑widths. We had a discussion last week on GitHub about some of these
problems, and my band-aid worked for a couple of things, but was by no means
comphrenesive.
[1] https://ucs-detect.readthedocs.io/intro.html
[2] https://wcwidth.readthedocs.io/en/latest/specs.html
The improvements are in:
https://gist.github.com/migueldeicaza/a81dc7fd5a31f10cd24b2ba60b28a083
See the bug for before/after screenshots.
This fixes #4277 files changed
Lines changed: 527 additions & 631 deletions
File tree
- Sources/SwiftTerm
- Apple
- iOS
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
0 commit comments