From f7c558e733ae7aa6b31334586184a543d5b8457d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 7 Jan 2024 14:54:15 -0800 Subject: [PATCH] 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. --- src/renderer/cell.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/cell.zig b/src/renderer/cell.zig index 56d606b6c..9bbd8fd7b 100644 --- a/src/renderer/cell.zig +++ b/src/renderer/cell.zig @@ -41,7 +41,9 @@ pub fn fgMode( // the subsequent character is empty, then we allow it to use // the full glyph size. See #1071. .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; }