renderer: constrain dingbats category to cell size

Dingbats are generally symbolic glyphs that frequently overflow the
cell. Their defined codepoint width is "1" so they take one cell but
very often overflow to the next.

This extends the previously created logic for Nerd Font symbols such
that when a dingbat is next to whitespace, we allow it to use the full
size, but when a dingbat is next to an occupied cell we constrain it to
the cell size.
This commit is contained in:
Mitchell Hashimoto
2024-01-07 14:54:15 -08:00
parent f6e93c8748
commit f7c558e733

View File

@ -41,7 +41,9 @@ pub fn fgMode(
// the subsequent character is empty, then we allow it to use // the subsequent character is empty, then we allow it to use
// the full glyph size. See #1071. // the full glyph size. See #1071.
.text => text: { .text => text: {
if (!ziglyph.general_category.isPrivateUse(@intCast(cell.char))) { if (!ziglyph.general_category.isPrivateUse(@intCast(cell.char)) and
!ziglyph.blocks.isDingbats(@intCast(cell.char)))
{
break :text .normal; break :text .normal;
} }