summaryrefslogtreecommitdiff
path: root/src/unicode
diff options
context:
space:
mode:
authorJacob Sandlund <jacob@jacobsandlund.com>2025-08-05 23:59:30 -0400
committerJacob Sandlund <jacob@jacobsandlund.com>2025-08-05 23:59:30 -0400
commit0c393299b0053964ece7e83a40cf18a4c8f4acbf (patch)
treed2f80a08196e7b50d060c50748434c59851e76b3 /src/unicode
parent8dec520b41ea5a3ff58b858e004407d16a65f2ba (diff)
using just `get`
Diffstat (limited to 'src/unicode')
-rw-r--r--src/unicode/props.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/unicode/props.zig b/src/unicode/props.zig
index 99c57aa0a..f611b9311 100644
--- a/src/unicode/props.zig
+++ b/src/unicode/props.zig
@@ -2,6 +2,7 @@ const props = @This();
const std = @import("std");
const assert = std.debug.assert;
const ziglyph = @import("ziglyph");
+const uucode = @import("uucode");
const lut = @import("lut.zig");
/// The lookup tables for Ghostty.
@@ -121,10 +122,10 @@ pub const GraphemeBoundaryClass = enum(u4) {
};
pub fn get(cp: u21) Properties {
- const zg_width = ziglyph.display_width.codePointWidth(cp, .half);
+ const wcwidth = if (cp < 0x110000) uucode.get("wcwidth", cp) else 0;
return .{
- .width = @intCast(@min(2, @max(0, zg_width))),
+ .width = @intCast(@min(2, @max(0, wcwidth))),
.grapheme_boundary_class = .init(cp),
};
}