commit 9c4a9f8546611a1f5a2df3404c0fde429e39b948 from: Josh Wainwright date: Fri Jun 05 10:45:07 2015 UTC Add keybinging to jump to top/bottom of listing. Uses single g for top (as in less) and G for bottom. commit - c8d8e76b74bd1cc482dfabc8f05adfae01524f4f commit + 9c4a9f8546611a1f5a2df3404c0fde429e39b948 blob - b421f9a77e7441295fbf3d771ce85614a0eb8837 blob + 2692cf950b816a7dba4a9e12347e9c4cf981c2f0 --- README.md +++ README.md @@ -32,6 +32,7 @@ Quick Start ? - show Rover manual j/k - move cursor down/up J/K - move cursor down/up 10 lines + g/G - move cursor to top/bottom of listing l - enter selected directory h - go to parent directory H - go to $HOME directory blob - e7bbd912338887333c3535ecbad88562cb97cd37 blob + c6492496c52c27c2b7567ebdcaec5b70660c4be3 --- config.h +++ config.h @@ -8,6 +8,8 @@ #define RVK_UP "k" #define RVK_JUMP_DOWN "J" #define RVK_JUMP_UP "K" +#define RVK_JUMP_TOP "g" +#define RVK_JUMP_BOTTOM "G" #define RVK_CD_DOWN "l" #define RVK_CD_UP "h" #define RVK_HOME "H" blob - e72d3dabf7f083a54ec772ea1624c44da8c92e5c blob + 4a575ae9b193f6eb8d179a83fd471ba1a4f37405 --- rover.1 +++ rover.1 @@ -72,6 +72,9 @@ Move cursor down/up. .B J/K Move cursor down/up 10 lines. .TP +.B g/G +Move cursor to top/bottom of listing. +.TP .B l Enter selected directory. .TP blob - 54e68b7752e95a42a1a8a33b632e9955cd9d1c68 blob + 1b5d28e101939accc8c7331774b8a64d8c5923b2 --- rover.c +++ rover.c @@ -837,6 +837,16 @@ main(int argc, char *argv[]) if (!rover.nfiles) continue; ESEL = MAX(ESEL - RV_JUMP, 0); SCROLL = MAX(SCROLL - RV_JUMP, 0); + update_view(); + } else if (!strcmp(key, RVK_JUMP_TOP)) { + if (!rover.nfiles) continue; + ESEL = 0; + SCROLL = 0; + update_view(); + } else if (!strcmp(key, RVK_JUMP_BOTTOM)) { + if (!rover.nfiles) continue; + ESEL = rover.nfiles - 1; + SCROLL = HEIGHT - rover.nfiles - 1; update_view(); } else if (!strcmp(key, RVK_CD_DOWN)) { if (!rover.nfiles || !ISDIR(ENAME(ESEL))) continue;