summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJulian Hurst <ark@mansus.space>2025-03-21 18:00:02 +0100
committerJulian Hurst <ark@mansus.space>2025-03-21 18:00:02 +0100
commit6cb9d6f8756e690e6cd2360b8b1ab531da45c405 (patch)
treede0ba6160942e1663cd3a298b878f1857598c124 /cmd
parent1c3531d4da2e2f56bf09c38a756a8c5f7c615b80 (diff)
downloadhare-tui-6cb9d6f8756e690e6cd2360b8b1ab531da45c405.tar.gz
Simply and fix reframe and introduce bounds checks for setcursor
Diffstat (limited to 'cmd')
-rw-r--r--cmd/il.ha16
1 files changed, 16 insertions, 0 deletions
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);
};