Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Support grapheme clusters - #6

Draft
hhirtz wants to merge 1 commit into
masterfrom
grapheme-clusters
Draft

hhirtz wants to merge 1 commit into
masterfrom
grapheme-clusters

Conversation

@hhirtz

@hhirtz hhirtz commented Nov 6, 2021

Copy link
Copy Markdown
Owner

TODO

  • make the input field work correctly
  • figure out problems with foot: explanation here https://codeberg.org/dnkl/foot/issues/782#issuecomment-278311
    1. the emoji seems to hide the text: screen-20211106233630
    2. selecting hidden letters uncovers them screen-20211106233722
    3. and you can unselect the thing and it (looks like it) works screen-20211106233802
  • figure out problems with kitty: screen-20211106234039
  • figure out if some of the problems come from tcell

Related, maybe?

It seems there is no way to compute the width of a grapheme cluster, so I think the best way to go is to not change the way senpai computes the width of strings (rune by rune), but still tell tcell to render the grapheme cluster as one.


senpai now correctly computes the width of unicode strings, such as
sequences of emoji interleaved with Zero-Width-Joiners, and the editor
goes from cluster to cluster, instead of codepoint (rune) to codepoint.

This breaks users on terminal that do not support grapheme clusters,
such as alacritty[0].

See http://unicode.org/reports/tr29/
and https://github.com/rivo/uniseg

[0] alacritty/alacritty#3975

senpai now correctly computes the width of unicode strings, such as
sequences of emoji interleaved with Zero-Width-Joiners, and the editor
goes from cluster to cluster, instead of codepoint (rune) to codepoint.

This breaks users on terminal that do not support grapheme clusters,
such as alacritty[0].

See http://unicode.org/reports/tr29/
and https://github.com/rivo/uniseg

[0] alacritty/alacritty#3975
@hhirtz
hhirtz force-pushed the grapheme-clusters branch from 75a91c3 to 2ca8e2d Compare November 7, 2021 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant