From b2163c0a53a6276bc8e1211e9a7c9584bb1ccb2e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 22:46:21 -0300 Subject: width: the core measures a grapheme's cells over uucode itself, File.utf8Width beside graphemeDisplayWidth, so libvaxis leaves the core module (build.zig gives it to main.zig's roots alone, the tui's and the gui's); it is libvaxis's gwidth(.unicode) over the same uucode tables in one pass (a grapheme as wide as its widest code point, the text selector, the emoji selector, emoji presentation and a flag's pair as there), and returned the same width on every Unicode scalar value (1,112,064), 76 multi-codepoint graphemes and 2,000,000 random sequences of joiners, selectors, marks, jamo, regional indicators and any scalar, and graphemeDisplayWidth the same on 6,260,096 byte strings, invalid UTF-8 included (a test run once, then removed); 204 instructions a non-ASCII grapheme against vaxis's 309 (ReleaseFast), a render of perf's small file 11,679,818 instructions against 11,685,276; surface.zig and draw.zig's test call it; tui.zig's test holds vaxis's width to it on a corpus, as vaxis renders the cells the core lays out; the changelog says so --- build.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 0e67b61e..26eb0c5c 100644 --- a/build.zig +++ b/build.zig @@ -842,7 +842,9 @@ pub fn build(b: *std.Build) void { .mvzr = mvzr_mod, .c_heap = c_heap_mod, .ghostty_vt = ghostty_core_vt, - .vaxis = vaxis_mod, + // The tui's and the gui's (main.zig's roots); the core measures + // text with uucode alone (File.utf8Width). + .vaxis = if (m == core_module) null else vaxis_mod, .uucode = uucode_mod, .wuffs = wuffs_mod, .xitdb = xitdb_mod, -- cgit v1.3