diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 22:46:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | b2163c0a53a6276bc8e1211e9a7c9584bb1ccb2e (patch) | |
| tree | b24a6c5991f6d79e8baecb24f2ad50e3a8e8035d /src/draw.zig | |
| parent | f2b02c455f2bcdfb905a015eefbb630a28b4b12e (diff) | |
| download | pardes-b2163c0a53a6276bc8e1211e9a7c9584bb1ccb2e.tar.gz pardes-b2163c0a53a6276bc8e1211e9a7c9584bb1ccb2e.zip | |
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
Diffstat (limited to 'src/draw.zig')
| -rw-r--r-- | src/draw.zig | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/draw.zig b/src/draw.zig index 7d199155..a0a28cc7 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -4,7 +4,6 @@ //! 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"); @@ -1330,7 +1329,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 vaxis.gwidth.gwidth(cell.grapheme(), .unicode) == 2)); + if (i + 1 == row.len) try std.testing.expect(!head and !(cell.len > 1 and panes.File.utf8Width(cell.grapheme()) == 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); |
