summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-18 11:42:09 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-18 11:42:09 +0200
commit33b8635d06f785f9d088d4c9485d89f00898424a (patch)
treee4e51a4ac0abb7f81d3b2112186f2deb86531038 /clients
parentf60f0dde660df10233db52bd8ea10481a01f26ce (diff)
downloadbokf-33b8635d06f785f9d088d4c9485d89f00898424a.tar.gz
bokf-33b8635d06f785f9d088d4c9485d89f00898424a.zip
bokftui: PgUp/PgDn clamp to the first/last row in listsv0.1.18
select_list refused to move when fewer than a full page remained; menu already clamped. Matches the menu behaviour now.
Diffstat (limited to 'clients')
-rw-r--r--clients/bokftui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/clients/bokftui.c b/clients/bokftui.c
index 1514126..25e5464 100644
--- a/clients/bokftui.c
+++ b/clients/bokftui.c
@@ -766,10 +766,10 @@ static int select_list(const char *title, char **items, int n, int start,
sel--;
else if (ch == KEY_DOWN && sel < n - 1)
sel++;
- else if (ch == KEY_NPAGE && sel + view < n)
- sel += view;
- else if (ch == KEY_PPAGE && sel - view >= 0)
- sel -= view;
+ else if (ch == KEY_NPAGE)
+ sel = sel + view < n ? sel + view : n - 1;
+ else if (ch == KEY_PPAGE)
+ sel = sel - view > 0 ? sel - view : 0;
else if (ch == KEY_HOME)
sel = 0;
else if (ch == KEY_END)