]> Sergey Matveev's repositories - nnn.git/commitdiff
Faster movement key bindings
authorlostd <lostd@2f30.org>
Fri, 10 Oct 2014 12:46:13 +0000 (15:46 +0300)
committerlostd <lostd@2f30.org>
Fri, 10 Oct 2014 12:46:13 +0000 (15:46 +0300)
noice.c

diff --git a/noice.c b/noice.c
index 3330b675a8d7fd594333b0a20a93f3be7c942f08..4af580ecfefe7dba9b8298a1422338479a069be8 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -229,6 +229,18 @@ nextsel(int *cur, int max)
                if (*cur > 0)
                        (*cur)--;
                break;
+       /* Page down */
+       case KEY_NPAGE:
+       case CONTROL('D'):
+               if (*cur < max -1)
+                       (*cur) += MIN((LINES - 4) / 2, max - 1 - *cur);
+               break;
+       /* Page up */
+       case KEY_PPAGE:
+       case CONTROL('U'):
+               if (*cur > 0)
+                       (*cur) -= MIN((LINES - 4) / 2, *cur);
+               break;
        }
 
        return 0;