Defect: We'd run into an infinite loop in the fallbackFor code, because we were assuming a character index when we actually needed a byte offset. This is another case where it'd be great to have the type system help us differentiate between these!
Fix: The value passed into fallbackFor is a byte index, not a character index - so use Zed_utf8.extract, which operates on byte offsets, instead of get, which operates on character indices. Add several test cases.
Issue: Certain unicode constructions could cause the font-fallback algorithm to hang, as described in https://github.com/onivim/oni2/issues/2178
Defect: We'd run into an infinite loop in the
fallbackFor
code, because we were assuming acharacter index
when we actually needed abyte offset
. This is another case where it'd be great to have the type system help us differentiate between these!Fix: The value passed into
fallbackFor
is a byte index, not a character index - so useZed_utf8.extract
, which operates on byte offsets, instead ofget
, which operates on character indices. Add several test cases.