tog: implement ctrl+f/b for diff view, sync man page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
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;