From 6cb9d6f8756e690e6cd2360b8b1ab531da45c405 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Fri, 21 Mar 2025 18:00:02 +0100 Subject: Simply and fix reframe and introduce bounds checks for setcursor --- cmd/il.ha | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cmd/il.ha') diff --git a/cmd/il.ha b/cmd/il.ha index afc1ee5..b6d1efb 100644 --- a/cmd/il.ha +++ b/cmd/il.ha @@ -61,6 +61,22 @@ export fn main() void = { if (r == 'K') { list::frameup(&li); }; + if (r == 'd') { + const nextpage = li.cursor + li.frame.end - li.frame.start; + fmt::errorln(nextpage)!; + list::setcursor(&li, nextpage); + fmt::errorln(li.frame.start)!; + fmt::errorln(li.frame.end)!; + fmt::errorln()!; + }; + if (r == 'u') { + const prevpage = li.cursor - (li.frame.end - li.frame.start); + fmt::errorln(prevpage)!; + list::setcursor(&li, prevpage); + fmt::errorln(li.frame.start)!; + fmt::errorln(li.frame.end)!; + fmt::errorln()!; + }; if (r == 'g') { list::top(&li); }; -- cgit v1.2.3