Remix.run Logo
dhosek 8 hours ago

Grapheme count is not a useful number. Even in a monospaced font, you’ll find that the grapheme count doesn’t give you a measurement of width since emoji will usually not be the same width as other characters.

paulddraper 7 hours ago | parent | next [-]

Grapheme count (or rather, indexing) is necessary to do text selection or cursor positions.

Fortunately you can usually outsource this to a UI toolkit which can do it.

Spivak 7 hours ago | parent | prev [-]

For certain use-cases, but it's not like any of the other usual notions of text length are any better for what you want.

lmm 4 hours ago | parent [-]

If all possible notions of length are footguns, maybe there should be no default "length" operation available.