diff options
Diffstat (limited to 'libui/list/list.ha')
| -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)?; |
