link index and page on first and last line
authorLaurent Mazet <mazet@softndesign.org>
Fri, 3 Jan 2025 14:09:01 +0000 (15:09 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Fri, 3 Jan 2025 14:09:01 +0000 (15:09 +0100)
fm.c

diff --git a/fm.c b/fm.c
index acd5581910ebb9129600dc7ecb0e1eacd4cc0a3a..c951224eca54a138dc0b9153e403dea197bc5d53 100644 (file)
--- a/fm.c
+++ b/fm.c
@@ -154,6 +154,8 @@ int main (int argc, char *argv[])
         case 'i':
             if (index_y > 0) {
                 index_y--;
+            } else if (page > 0) {
+                page--;
             }
             break;
         case KEY_LEFT:
@@ -166,6 +168,8 @@ int main (int argc, char *argv[])
         case 'k':
             if (index_y < min (windir->ysize, (list->nb + windir->nbcols - 1) / windir->nbcols) - 1) {
                 index_y++;
+            } else if (page + windir->ysize < (list->nb + windir->nbcols - 1) / windir->nbcols) {
+                page++;
             }
             break;
         case KEY_RIGHT: