summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 00:45:31 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit84c2699e22d9660ef5b6de54643c0c78f2e8e855 (patch)
treedc2851d34184ee695613a16b6e72efc45d1120de /src/draw.zig
parent191d0eca0ba25b94ce2b466cc11b879e7553473a (diff)
downloadpardes-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/draw.zig')
-rw-r--r--src/draw.zig3
1 files changed, 2 insertions, 1 deletions
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);