diff options
| author | Julian Hurst <ark@mansus.space> | 2022-05-05 19:02:00 +0200 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2022-05-05 19:02:00 +0200 |
| commit | 6aa1de7118b0b813cdbff631a22e04d8944dc951 (patch) | |
| tree | e016070c2b0eef8cb663dd05170ea0b28f7a67f4 /libui/list | |
| parent | c21fc5f59b93631b85d7f1d089c24e24360a9bb2 (diff) | |
| download | ilhare-6aa1de7118b0b813cdbff631a22e04d8944dc951.tar.gz | |
sigwinch and newline weirdness
Diffstat (limited to 'libui/list')
| -rw-r--r-- | libui/list/list.ha | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libui/list/list.ha b/libui/list/list.ha index 6b11b75..6cbafd7 100644 --- a/libui/list/list.ha +++ b/libui/list/list.ha @@ -58,22 +58,22 @@ export fn addlistener(list: *listwidget, l: listener) void = { }; export fn print(list: *listwidget) (void | io::error | tty::error) = { - let sz = libui::getwinsize(list.ui)?; - let rows: (u16 | size) = if (sz.rows - 2 < len(list.items)) { - yield sz.rows - 2; - } else { - yield len(list.items); - }; + //let sz = libui::getwinsize(list.ui)?; + //let rows: (u16 | size) = if (sz.rows - 2 < len(list.items)) { + //yield sz.rows - 2; + //} else { + //yield len(list.items); + //}; //fmt::fprintln(os::stderr, rows)!; - list.frame.end = list.frame.start + rows: u16; + list.frame.end = list.frame.start + list.sz.rows; let st = strio::dynamic(); strio::concat(&st, "\r")?; for (let i = list.frame.start; i < list.frame.end: u16; i += 1) { let item = list.items[i]; - let truncitem = wcwidth::truncate(item, sz.columns); + let truncitem = wcwidth::truncate(item, list.sz.cols); if (list.cursor == i) { strio::concat(&st, "\x1B[104;1m\x1B[30m")?; strio::concat(&st, truncitem)?; |
