From 3765dbef2bcc0cea48ef4bdb32a09c2f19493b30 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 7 Jun 2024 22:31:40 -0500 Subject: [PATCH] widgets(terminal): handle (some) wrapping --- src/widgets/terminal/Screen.zig | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/terminal/Screen.zig b/src/widgets/terminal/Screen.zig index 90df960..8c6e099 100644 --- a/src/widgets/terminal/Screen.zig +++ b/src/widgets/terminal/Screen.zig @@ -153,12 +153,11 @@ pub fn print( grapheme: []const u8, width: u8, ) void { - - // FIXME: wrapping - // if (self.cursor.col + width >= self.width) { - // self.cursor.col = 0; - // self.cursor.row += 1; - // } + // TODO: wrap mode handling + if (self.cursor.col + width > self.width) { + self.cursor.col = 0; + self.cursor.row += 1; + } if (self.cursor.col >= self.width) return; if (self.cursor.row >= self.height) return; const col = self.cursor.col;