commit bccd1d5d167c0b7fabb334513fdb5250df673c9a from: Stefan Sperling via: Thomas Adam date: Mon Jun 13 17:55:22 2022 UTC add less(1)-style key bindings for up/down to tog; patch by Mikhail commit - 314444e45ab5ffcb7b53c840c3eccf9b514fb70c commit + bccd1d5d167c0b7fabb334513fdb5250df673c9a blob - 9ffaae36730332eea4010cd1a92aca8e2ad8117a blob + 5221b4add67bbde2639bed5f044e0c1a96247bb1 --- tog/tog.1 +++ tog/tog.1 @@ -104,9 +104,9 @@ are as follows: Move the selection cursor down. .It Cm Up-arrow, k, <, Comma, Ctrl-p Move the selection cursor up. -.It Cm Page-down, Ctrl+f +.It Cm Page-down, Ctrl+f, d, Ctrl+d Move the selection cursor down one page. -.It Cm Page-up, Ctrl+b +.It Cm Page-up, Ctrl+b, u, Ctrl+u Move the selection cursor up one page. .It Cm Home, g Move the cursor to the newest commit. @@ -215,9 +215,9 @@ detected. Scroll down. .It Cm Up-arrow, k, Ctrl-p Scroll up. -.It Cm Page-down, Space, Ctrl+f +.It Cm Page-down, Space, Ctrl+f, d, Ctrl+d Scroll down one page. -.It Cm Page-up, Ctrl+b +.It Cm Page-up, Ctrl+b, u, Ctrl+u Scroll up one page. .It Cm Home, g Scroll to the top of the view. @@ -282,9 +282,9 @@ are as follows: Move the selection cursor down. .It Cm Up-arrow, k, Ctrl-p Move the selection cursor up. -.It Cm Page-down, Space, Ctrl+f +.It Cm Page-down, Space, Ctrl+f, d, Ctrl+d Move the selection cursor down one page. -.It Cm Page-up, Ctrl+b +.It Cm Page-up, Ctrl+b, u, Ctrl+u Move the selection cursor up one page. .It Cm Home, g Move the selection cursor to the first line of the file. @@ -361,9 +361,9 @@ are as follows: Move the selection cursor down. .It Cm Up-arrow, k, Ctrl-p Move the selection cursor up. -.It Cm Page-down, Ctrl+f +.It Cm Page-down, Ctrl+f, d, Ctrl+d Move the selection cursor down one page. -.It Cm Page-up, Ctrl+b +.It Cm Page-up, Ctrl+b, u, Ctrl+u Move the selection cursor up one page. .It Cm Home, g Move the selection cursor to the first entry. @@ -431,9 +431,9 @@ are as follows: Move the selection cursor down. .It Cm Up-arrow, k, Ctrl-p Move the selection cursor up. -.It Cm Page-down, Ctrl+f +.It Cm Page-down, Ctrl+f, d, Ctrl+d Move the selection cursor down one page. -.It Cm Page-up, Ctrl+b +.It Cm Page-up, Ctrl+b, u, Ctrl+u Move the selection cursor up one page. .It Cm Home, g Move the selection cursor to the first reference. blob - ad7497fe87466793273c17d960dd6fe642e8af2c blob + 1380be4dfb16e626479b19e769d6cd38503dd7e9 --- tog/tog.c +++ tog/tog.c @@ -2490,6 +2490,8 @@ input_log_view(struct tog_view **new_view, struct tog_ break; case KEY_PPAGE: case CTRL('b'): + case CTRL('u'): + case 'u': if (s->first_displayed_entry == NULL) break; if (TAILQ_FIRST(&s->commits.head) == s->first_displayed_entry) @@ -2538,7 +2540,9 @@ input_log_view(struct tog_view **new_view, struct tog_ break; } case KEY_NPAGE: - case CTRL('f'): { + case CTRL('f'): + case CTRL('d'): + case 'd': { struct commit_queue_entry *first; first = s->first_displayed_entry; if (first == NULL) @@ -3796,6 +3800,8 @@ input_diff_view(struct tog_view **new_view, struct tog break; case KEY_PPAGE: case CTRL('b'): + case CTRL('u'): + case 'u': if (s->first_displayed_line == 1) break; i = 0; @@ -3812,6 +3818,8 @@ input_diff_view(struct tog_view **new_view, struct tog case KEY_NPAGE: case CTRL('f'): case ' ': + case CTRL('d'): + case 'd': if (s->eof) break; i = 0; @@ -4671,6 +4679,8 @@ input_blame_view(struct tog_view **new_view, struct to break; case KEY_PPAGE: case CTRL('b'): + case CTRL('u'): + case 'u': if (s->first_displayed_line == 1) { s->selected_line = 1; break; @@ -4825,6 +4835,8 @@ input_blame_view(struct tog_view **new_view, struct to case KEY_NPAGE: case CTRL('f'): case ' ': + case CTRL('d'): + case 'd': if (s->last_displayed_line >= s->blame.nlines && s->selected_line >= MIN(s->blame.nlines, view->nlines - 2)) { @@ -5609,6 +5621,8 @@ input_tree_view(struct tog_view **new_view, struct tog break; case KEY_PPAGE: case CTRL('b'): + case CTRL('u'): + case 'u': if (s->tree == s->root) { if (got_object_tree_get_first_entry(s->tree) == s->first_displayed_entry) @@ -5634,6 +5648,8 @@ input_tree_view(struct tog_view **new_view, struct tog break; case KEY_NPAGE: case CTRL('f'): + case CTRL('d'): + case 'd': if (got_tree_entry_get_next(s->tree, s->last_displayed_entry) == NULL) { /* can't scroll any further; move cursor down */ @@ -6422,6 +6438,8 @@ input_ref_view(struct tog_view **new_view, struct tog_ break; case KEY_PPAGE: case CTRL('b'): + case CTRL('u'): + case 'u': if (s->first_displayed_entry == TAILQ_FIRST(&s->refs)) s->selected = 0; ref_scroll_up(s, MAX(0, view->nlines - 1)); @@ -6440,6 +6458,8 @@ input_ref_view(struct tog_view **new_view, struct tog_ break; case KEY_NPAGE: case CTRL('f'): + case CTRL('d'): + case 'd': if (TAILQ_NEXT(s->last_displayed_entry, entry) == NULL) { /* can't scroll any further; move cursor down */ if (s->selected < s->ndisplayed - 1)