Commit ea025d1dbc11c33fec290591f35673b896edd822

Christian Weisgerber 2020-02-22T20:29:17

add ^B/^F key bindings for page up/down in the "blame" and "tree" views

diff --git a/tog/tog.1 b/tog/tog.1
index dc2613f..0dd6540 100644
--- a/tog/tog.1
+++ b/tog/tog.1
@@ -211,10 +211,14 @@ The key bindings for
 .Cm tog blame
 are as follows:
 .Bl -tag -width Ds
-.It Cm Down-arrow, j, Page-down, Space
+.It Cm Down-arrow, j
 Move the selection cursor down.
-.It Cm Up-arrow, k, Page-up
+.It Cm Up-arrow, k
 Move the selection cursor up.
+.It Cm Page-down, Space, Ctrl+f
+Move the selection cursor down one page.
+.It Cm Page-up, Ctrl+b
+Move the selection cursor up one page.
 .It Cm Enter
 Open a
 .Cm diff
@@ -277,10 +281,14 @@ The key bindings for
 .Cm tog tree
 are as follows:
 .Bl -tag -width Ds
-.It Cm Down-arrow, j, Page-down
+.It Cm Down-arrow, j
 Move the selection cursor down.
-.It Cm Up-arrow, k, Page-up
+.It Cm Up-arrow, k
 Move the selection cursor up.
+.It Cm Page-down, Ctrl+f
+Move the selection cursor down one page.
+.It Cm Page-up, Ctrl+b
+Move the selection cursor up one page.
 .It Cm Enter
 Enter the currently selected directory, or switch to the
 .Cm blame
diff --git a/tog/tog.c b/tog/tog.c
index 9e80090..cedb43d 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -4164,6 +4164,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view **dead_view,
 			s->first_displayed_line--;
 		break;
 	case KEY_PPAGE:
+	case CTRL('b'):
 		if (s->first_displayed_line == 1) {
 			s->selected_line = 1;
 			break;
@@ -4319,6 +4320,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view **dead_view,
 		break;
 	}
 	case KEY_NPAGE:
+	case CTRL('f'):
 	case ' ':
 		if (s->last_displayed_line >= s->blame.nlines &&
 		    s->selected_line >= MIN(s->blame.nlines,
@@ -5038,6 +5040,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view **dead_view,
 		    s->tree, s->tree == s->root);
 		break;
 	case KEY_PPAGE:
+	case CTRL('b'):
 		tree_scroll_up(view, &s->first_displayed_entry,
 		    MAX(0, view->nlines - 4 - s->selected), s->tree,
 		    s->tree == s->root);
@@ -5060,6 +5063,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view **dead_view,
 		    s->last_displayed_entry, s->tree);
 		break;
 	case KEY_NPAGE:
+	case CTRL('f'):
 		if (got_tree_entry_get_next(s->tree, s->last_displayed_entry)
 		    == NULL) {
 			/* can't scroll any further; move cursor down */