summaryrefslogtreecommitdiff
path: root/tui/widget/list/list.ha
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2025-03-20 13:54:08 +0100
committerJulian Hurst <ark@mansus.space>2025-03-20 13:54:08 +0100
commit5e93fe240e489ff13a90a7ff29fee415c8113cc9 (patch)
tree98c16dc327c242b47d813deab6e2c1bd4b412f46 /tui/widget/list/list.ha
parent39b580c33ce568bb3b055df6bc4b16fa5969e77b (diff)
parent3a137cfcfbc8686f2441de9604b15dc5d9ab4cd7 (diff)
downloadhare-tui-5e93fe240e489ff13a90a7ff29fee415c8113cc9.tar.gz
Merge branch 'master' into nomem
Diffstat (limited to 'tui/widget/list/list.ha')
-rw-r--r--tui/widget/list/list.ha11
1 files changed, 6 insertions, 5 deletions
diff --git a/tui/widget/list/list.ha b/tui/widget/list/list.ha
index 56588ec..cbf83fa 100644
--- a/tui/widget/list/list.ha
+++ b/tui/widget/list/list.ha
@@ -6,8 +6,8 @@ use memio;
use strings;
export type frame = struct {
- start: u16,
- end: u16,
+ start: int,
+ end: int,
};
export type list = struct {
@@ -29,9 +29,10 @@ style: (*widget::style | void), items: str...) (list | tty::error) = {
case void =>
yield tsz.rows - 1;
};
+ let end = end: int;
- if (end > len(items)) {
- end = len(items): u16;
+ if (end > len(items): int) {
+ end = len(items): int;
};
return list {
@@ -49,7 +50,7 @@ style: (*widget::style | void), items: str...) (list | tty::error) = {
items = items,
frame = frame {
start = 0,
- end = end,
+ end = end: int,
},
};
};