widgets(terminal): handle (some) wrapping
This commit is contained in:
parent
7a7f4892d7
commit
3765dbef2b
1 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue