From 84c2699e22d9660ef5b6de54643c0c78f2e8e855 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:45:31 -0300 Subject: width: back to libvaxis's gwidth, the user's ruling (keeping a dependency beats reimplementing it in the core): vmkopprq reverted: the core measures a grapheme's cells with vaxis.gwidth.gwidth(.unicode) again (File.graphemeDisplayWidth and its neighbours, surface.zig, draw.zig's test), File.utf8Width and tui.zig's corpus test that held vaxis's width to it go, and build.zig gives libvaxis to the core module again, so vaxis stays a dependency of the core; the widths were the same on every Unicode scalar value (vmkopprq's proof), so every golden and snapshot is unchanged; the changelog's shared entry keeps the palette sentence alone --- src/draw.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/draw.zig') diff --git a/src/draw.zig b/src/draw.zig index 238f459a..9a71ab1d 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -4,6 +4,7 @@ //! chips, the workspace and column tags, the tag layers, drag overlays, the //! debug box, then the cursor. const std = @import("std"); +const vaxis = @import("vaxis"); const pardes = @import("pardes.zig"); const layout = @import("layout.zig"); const config = @import("config.zig"); @@ -1329,7 +1330,7 @@ test "a wide glyph cut by a tag's or a notice's edge is joined into the grid as const head = !cell.default and cell.len > 1 and i + 1 < row.len and !row[i + 1].default and row[i + 1].len == 0; // A spacer has its head before it; a head its spacer after. if (spacer) try std.testing.expect(i > 0 and row[i - 1].len > 1); - if (i + 1 == row.len) try std.testing.expect(!head and !(cell.len > 1 and panes.File.utf8Width(cell.grapheme()) == 2)); + if (i + 1 == row.len) try std.testing.expect(!head and !(cell.len > 1 and vaxis.gwidth.gwidth(cell.grapheme(), .unicode) == 2)); } // The right edge of each is the band, blank where a glyph was cut. try std.testing.expectEqual(FontRole.tagline, row[row.len - 1].style.font_role); -- cgit v1.3