only test presentation VS15/16 if directly adjacent to codepoint

This commit is contained in:
Mitchell Hashimoto
2022-09-06 14:26:43 -07:00
parent da7843e8b4
commit 3f1942223b

View File

@ -177,8 +177,10 @@ pub const RunIterator = struct {
// Determine the presentation format for this glyph.
const presentation: ?Presentation = if (cell.attrs.grapheme) p: {
// We only check the FIRST codepoint because I believe the
// presentation format must be directly adjacent to the codepoint.
var it = self.row.codepointIterator(j);
while (it.next()) |cp| {
if (it.next()) |cp| {
if (cp == 0xFE0E) break :p Presentation.text;
if (cp == 0xFE0F) break :p Presentation.emoji;
}