diff options
| author | Julian Hurst <ark@mansus.space> | 2025-03-20 13:53:59 +0100 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2025-03-20 13:53:59 +0100 |
| commit | 3a137cfcfbc8686f2441de9604b15dc5d9ab4cd7 (patch) | |
| tree | c4a9fc07a29da6889fe3cc0cfce0d55c50eaba28 /tui/widget/list/list.ha | |
| parent | ddac62a2a43ee62da4f5302e9cb2958f6ff82cea (diff) | |
| download | hare-tui-3a137cfcfbc8686f2441de9604b15dc5d9ab4cd7.tar.gz | |
Change frame and cursor to use int instead of u16 and fix reframe
Diffstat (limited to 'tui/widget/list/list.ha')
| -rw-r--r-- | tui/widget/list/list.ha | 11 |
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, }, }; }; |
