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,
|
grapheme: []const u8,
|
||||||
width: u8,
|
width: u8,
|
||||||
) void {
|
) void {
|
||||||
|
// TODO: wrap mode handling
|
||||||
// FIXME: wrapping
|
if (self.cursor.col + width > self.width) {
|
||||||
// if (self.cursor.col + width >= self.width) {
|
self.cursor.col = 0;
|
||||||
// self.cursor.col = 0;
|
self.cursor.row += 1;
|
||||||
// self.cursor.row += 1;
|
}
|
||||||
// }
|
|
||||||
if (self.cursor.col >= self.width) return;
|
if (self.cursor.col >= self.width) return;
|
||||||
if (self.cursor.row >= self.height) return;
|
if (self.cursor.row >= self.height) return;
|
||||||
const col = self.cursor.col;
|
const col = self.cursor.col;
|
||||||
|
|
Loading…
Reference in a new issue