Add emacs-like keybinds for next/prev entry selection

This commit is contained in:
sin 2014-10-09 15:54:07 +01:00
parent ac2a7e2788
commit dc711f2fad
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#define LEN(x) (sizeof(x) / sizeof(*(x)))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define ISODD(x) ((x) & 1)
#define CONTROL(c) ((c) ^ 0x40)
struct assoc {
char *regex; /* Regex to match on filename */
@ -182,12 +183,14 @@ nextsel(int *cur, int max)
/* next */
case 'j':
case KEY_DOWN:
case CONTROL('N'):
if (*cur < max - 1)
(*cur)++;
break;
/* prev */
case 'k':
case KEY_UP:
case CONTROL('P'):
if (*cur > 0)
(*cur)--;
break;