diff options
| author | Jacob Sandlund <jacob@jacobsandlund.com> | 2025-09-23 09:36:41 -0400 |
|---|---|---|
| committer | Jacob Sandlund <jacob@jacobsandlund.com> | 2025-09-23 09:36:41 -0400 |
| commit | b01770c21c9b393d6dcfacae75d9d1159be33f9a (patch) | |
| tree | 7bbfbdad2377f29aa11f9f90cb97d7c6e2bd306f /src/simd/codepoint_width.zig | |
| parent | 7b0722bf16043fe7ee099e2fd8ca11c78c976bc5 (diff) | |
| parent | 3eb646ea6baf5eb45bbd39cd7ad624cda0264554 (diff) | |
Merge remote-tracking branch 'upstream/main' into jacob/uucode
Diffstat (limited to 'src/simd/codepoint_width.zig')
| -rw-r--r-- | src/simd/codepoint_width.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/simd/codepoint_width.zig b/src/simd/codepoint_width.zig index f5806948a..c39cfb4f3 100644 --- a/src/simd/codepoint_width.zig +++ b/src/simd/codepoint_width.zig @@ -1,11 +1,14 @@ const std = @import("std"); +const options = @import("build_options"); // vt.cpp extern "c" fn ghostty_simd_codepoint_width(u32) i8; pub fn codepointWidth(cp: u32) i8 { - //return @import("uucode").get(.wcwidth, @intCast(cp)); - return ghostty_simd_codepoint_width(cp); + if (comptime options.simd) return ghostty_simd_codepoint_width(cp); + const uucode = @import("uucode"); + if (cp > uucode.config.max_code_point) return 1; + return @import("uucode").get(.width, @intCast(cp)); } test "codepointWidth basic" { |
