From 928d338c2b7e5224449f8c37be1c392e3c2cb5cf Mon Sep 17 00:00:00 2001 From: Erlend Lind Madsen Date: Fri, 9 Feb 2024 21:44:54 +0100 Subject: [PATCH] preeditCallback(self): remove fast path codepoint width --- src/Surface.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index db38c65ad..e9b27f05a 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1231,7 +1231,7 @@ pub fn preeditCallback(self: *Surface, preedit_: ?[]const u8) !void { var codepoints: std.ArrayListUnmanaged(Codepoint) = .{}; defer codepoints.deinit(self.alloc); while (it.nextCodepoint()) |cp| { - const width: usize = if (cp <= 0xFF) 1 else @intCast(unicode.table.get(cp).width); + const width: usize = @intCast(unicode.table.get(cp).width); // I've never seen a preedit text with a zero-width character. In // theory its possible but we can't really handle it right now.