From 3a137cfcfbc8686f2441de9604b15dc5d9ab4cd7 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 20 Mar 2025 13:53:59 +0100 Subject: Change frame and cursor to use int instead of u16 and fix reframe --- tui/widget/list/list.ha | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tui/widget/list/list.ha') 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, }, }; }; -- cgit v1.2.3