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

Support grapheme clusters #6

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Support grapheme clusters #6

wants to merge 1 commit into from

Conversation

hhirtz
Copy link
Owner

@hhirtz hhirtz commented Nov 6, 2021

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
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