diff options
| author | Julian Hurst <ark@mansus.space> | 2025-03-21 18:00:02 +0100 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2025-03-21 18:00:02 +0100 |
| commit | 6cb9d6f8756e690e6cd2360b8b1ab531da45c405 (patch) | |
| tree | de0ba6160942e1663cd3a298b878f1857598c124 /cmd/il.ha | |
| parent | 1c3531d4da2e2f56bf09c38a756a8c5f7c615b80 (diff) | |
| download | hare-tui-6cb9d6f8756e690e6cd2360b8b1ab531da45c405.tar.gz | |
Simply and fix reframe and introduce bounds checks for setcursor
Diffstat (limited to 'cmd/il.ha')
| -rw-r--r-- | cmd/il.ha | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); }; |
