Commit a60a9dc46f1d90c7105585745b7d892f31553700

joshua stein 2019-05-13T11:21:00

tog: implement ctrl+f/b for diff view, sync man page

diff --git a/tog/tog.1 b/tog/tog.1
index 52e4bd5..551ab14 100644
--- a/tog/tog.1
+++ b/tog/tog.1
@@ -90,12 +90,16 @@ are as follows:
 Move the selection cursor down.
 .It Cm Up-arrow, k, Page-up, <, Comma, Ctrl-b
 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, Space
 Open a
 .Cm diff
 view showing file changes made in the currently selected commit.
 .It Cm t
-Open a 
+Open a
 .Cm tree
 view showing the tree for the currently selected commit.
 .It Cm Backspace
@@ -130,10 +134,14 @@ The key bindings for
 .Cm tog diff
 are as follows:
 .Bl -tag -width Ds
-.It Cm Down-arrow, j, Page-down, Space
+.It Cm Down-arrow, j
 Scroll down.
 .It Cm Up-arrow, k, Page-up
 Scroll up.
+.It Cm Page-down, Space, Ctrl+f
+Scroll down one page.
+.It Cm Page-up, Ctrl+b
+Scroll up one page.
 .It Cm [
 Reduce the amount of diff context lines.
 .It Cm ]
diff --git a/tog/tog.c b/tog/tog.c
index f4576ea..a3ca552 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2340,6 +2340,7 @@ input_diff_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)
 			break;
 		i = 0;
@@ -2353,6 +2354,7 @@ input_diff_view(struct tog_view **new_view, struct tog_view **dead_view,
 			s->first_displayed_line++;
 		break;
 	case KEY_NPAGE:
+	case CTRL('f'):
 	case ' ':
 		if (s->eof)
 			break;