gwidth: fix gwidth for no_zwj case
This commit is contained in:
parent
15c64a0e66
commit
8a5fe1a8ab
1 changed files with 2 additions and 1 deletions
|
@ -31,7 +31,8 @@ pub fn gwidth(str: []const u8, method: Method) !usize {
|
|||
.no_zwj => {
|
||||
var out: [256]u8 = undefined;
|
||||
if (str.len > out.len) return error.OutOfMemory;
|
||||
const n = std.mem.replace(u8, str, "\u{200D}", "", &out);
|
||||
const n = std.mem.replacementSize(u8, str, "\u{200D}", "");
|
||||
_ = std.mem.replace(u8, str, "\u{200D}", "", &out);
|
||||
return gwidth(out[0..n], .unicode);
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue