Commit 33c3719a3133ea565d69348d51b7a65485dbbcee

Stefan Sperling 2022-06-15T08:50:55

re-add u/d keybindings as aliases for Ctrl-u/d, matching more(1) and less(1) patch by Mikhail

diff --git a/tog/tog.1 b/tog/tog.1
index e8c907d..56d9224 100644
--- a/tog/tog.1
+++ b/tog/tog.1
@@ -108,9 +108,9 @@ Move the selection cursor up.
 Move the selection cursor down one page.
 .It Cm Page-up, Ctrl+b
 Move the selection cursor up one page.
-.It Cm Ctrl+d
+.It Cm Ctrl+d, d
 Move the selection cursor down one half page.
-.It Cm Ctrl+u
+.It Cm Ctrl+u, u
 Move the selection cursor up one half page.
 .It Cm Home, g
 Move the cursor to the newest commit.
@@ -223,9 +223,9 @@ Scroll up.
 Scroll down one page.
 .It Cm Page-up, Ctrl+b
 Scroll up one page.
-.It Cm Ctrl+d
+.It Cm Ctrl+d, d
 Scroll down one half page.
-.It Cm Ctrl+u
+.It Cm Ctrl+u, u
 Scroll up one half page.
 .It Cm Home, g
 Scroll to the top of the view.
@@ -294,9 +294,9 @@ Move the selection cursor up.
 Move the selection cursor down one page.
 .It Cm Page-up, Ctrl+b
 Move the selection cursor up one page.
-.It Cm Ctrl+d
+.It Cm Ctrl+d, d
 Move the selection cursor down one half page.
-.It Cm Ctrl+u
+.It Cm Ctrl+u, u
 Move the selection cursor up one half page.
 .It Cm Home, g
 Move the selection cursor to the first line of the file.
@@ -377,9 +377,9 @@ Move the selection cursor up.
 Move the selection cursor down one page.
 .It Cm Page-up, Ctrl+b
 Move the selection cursor up one page.
-.It Cm Ctrl+d
+.It Cm Ctrl+d, d
 Move the selection cursor down one half page.
-.It Cm Ctrl+u
+.It Cm Ctrl+u, u
 Move the selection cursor up one half page.
 .It Cm Home, g
 Move the selection cursor to the first entry.
@@ -451,9 +451,9 @@ Move the selection cursor up.
 Move the selection cursor down one page.
 .It Cm Page-up, Ctrl+b
 Move the selection cursor up one page.
-.It Cm Ctrl+d
+.It Cm Ctrl+d, d
 Move the selection cursor down one half page.
-.It Cm Ctrl+u
+.It Cm Ctrl+u, u
 Move the selection cursor up one half page.
 .It Cm Home, g
 Move the selection cursor to the first reference.
diff --git a/tog/tog.c b/tog/tog.c
index 4f49803..d0d5836 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2480,6 +2480,7 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		select_commit(s);
 		break;
 	case CTRL('u'):
+	case 'u':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_PPAGE:
@@ -2532,6 +2533,7 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		break;
 	}
 	case CTRL('d'):
+	case 'd':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_NPAGE:
@@ -3792,6 +3794,7 @@ input_diff_view(struct tog_view **new_view, struct tog_view *view, int ch)
 			s->first_displayed_line--;
 		break;
 	case CTRL('u'):
+	case 'u':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_PPAGE:
@@ -3809,6 +3812,7 @@ input_diff_view(struct tog_view **new_view, struct tog_view *view, int ch)
 			s->first_displayed_line++;
 		break;
 	case CTRL('d'):
+	case 'd':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_NPAGE:
@@ -4672,6 +4676,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
 			s->first_displayed_line--;
 		break;
 	case CTRL('u'):
+	case 'u':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_PPAGE:
@@ -4827,6 +4832,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		break;
 	}
 	case CTRL('d'):
+	case 'd':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_NPAGE:
@@ -5612,6 +5618,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		tree_scroll_up(s, 1);
 		break;
 	case CTRL('u'):
+	case 'u':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_PPAGE:
@@ -5640,6 +5647,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		tree_scroll_down(s, 1);
 		break;
 	case CTRL('d'):
+	case 'd':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_NPAGE:
@@ -6432,6 +6440,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		ref_scroll_up(s, 1);
 		break;
 	case CTRL('u'):
+	case 'u':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_PPAGE:
@@ -6453,6 +6462,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		ref_scroll_down(s, 1);
 		break;
 	case CTRL('d'):
+	case 'd':
 		nscroll /= 2;
 		/* FALL THROUGH */
 	case KEY_NPAGE: