diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:45:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 84c2699e22d9660ef5b6de54643c0c78f2e8e855 (patch) | |
| tree | dc2851d34184ee695613a16b6e72efc45d1120de /src/surface.zig | |
| parent | 191d0eca0ba25b94ce2b466cc11b879e7553473a (diff) | |
| download | pardes-84c2699e22d9660ef5b6de54643c0c78f2e8e855.tar.gz pardes-84c2699e22d9660ef5b6de54643c0c78f2e8e855.zip | |
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
Diffstat (limited to 'src/surface.zig')
| -rw-r--r-- | src/surface.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/surface.zig b/src/surface.zig index 46b6c664..a5dbea8e 100644 --- a/src/surface.zig +++ b/src/surface.zig @@ -4,6 +4,7 @@ const pardes = @import("pardes.zig"); const std = @import("std"); const layout = @import("layout.zig"); const uucode = @import("uucode"); +const vaxis = @import("vaxis"); const panes = @import("panes.zig"); const config = @import("config.zig"); const MAX_PANES = pardes.MAX_PANES; @@ -424,7 +425,7 @@ pub const Surface = struct { const width: u16 = if (decoded == null or (cp < 0x80 and cp_slice.len == 1)) 1 else - @max(1, panes.File.utf8Width(cp_slice)); + @max(1, vaxis.gwidth.gwidth(cp_slice, .unicode)); if (width == 2 and col + 1 >= end) return null; var shown = cp_slice; if (shown.len > @typeInfo(@FieldType(Cell, "text")).array.len) { |
