mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
terminal: handle width==3 glyphs by just pretending they're width 2
This commit is contained in:
@ -770,7 +770,14 @@ pub fn print(self: *Terminal, c: u21) !void {
|
|||||||
|
|
||||||
// Determine the width of this character so we can handle
|
// Determine the width of this character so we can handle
|
||||||
// non-single-width characters properly.
|
// non-single-width characters properly.
|
||||||
const width: usize = @intCast(@max(0, ziglyph.display_width.codePointWidth(c, .half)));
|
const width: usize = @intCast(@min(
|
||||||
|
@max(0, ziglyph.display_width.codePointWidth(c, .half)),
|
||||||
|
2,
|
||||||
|
));
|
||||||
|
|
||||||
|
// Note: it is possible to have a width of "3" and a width of "-1"
|
||||||
|
// from ziglyph. We should look into those cases and handle them
|
||||||
|
// appropriately.
|
||||||
assert(width <= 2);
|
assert(width <= 2);
|
||||||
// log.debug("c={x} width={}", .{ c, width });
|
// log.debug("c={x} width={}", .{ c, width });
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user