diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 10 | ||||
-rw-r--r-- | src/nnn.h | 8 |
2 files changed, 15 insertions, 3 deletions
@@ -3064,10 +3064,18 @@ nochange: break; case SEL_PGDN: if (cur < ndents - 1) - cur += MIN((xlines - 4) / 2, ndents - 1 - cur); + cur += MIN((xlines - 4), ndents - 1 - cur); break; case SEL_PGUP: if (cur > 0) + cur -= MIN((xlines - 4), cur); + break; + case SEL_CTRL_D: + if (cur < ndents - 1) + cur += MIN((xlines - 4) / 2, ndents - 1 - cur); + break; + case SEL_CTRL_U: + if (cur > 0) cur -= MIN((xlines - 4) / 2, cur); break; case SEL_HOME: @@ -43,6 +43,8 @@ enum action { SEL_PREV, SEL_PGDN, SEL_PGUP, + SEL_CTRL_D, + SEL_CTRL_U, SEL_HOME, SEL_END, SEL_CDHOME, @@ -126,10 +128,12 @@ static struct key bindings[] = { { KEY_UP, SEL_PREV }, /* Page down */ { KEY_NPAGE, SEL_PGDN }, - { CONTROL('D'), SEL_PGDN }, /* Page up */ { KEY_PPAGE, SEL_PGUP }, - { CONTROL('U'), SEL_PGUP }, + /* Ctrl+D */ + { CONTROL('D'), SEL_CTRL_D }, + /* Ctrl+U */ + { CONTROL('U'), SEL_CTRL_U }, /* First entry */ { KEY_HOME, SEL_HOME }, { 'g', SEL_HOME }, |