diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-18 11:42:09 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-18 11:42:09 +0200 |
| commit | 33b8635d06f785f9d088d4c9485d89f00898424a (patch) | |
| tree | e4e51a4ac0abb7f81d3b2112186f2deb86531038 /clients | |
| parent | f60f0dde660df10233db52bd8ea10481a01f26ce (diff) | |
| download | bokf-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.c | 8 |
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) |
