"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mikhail <mp39590@gmail.com>
Subject:
J and K keybindings for diff view
To:
gameoftrees@openbsd.org
Date:
Sun, 17 Jul 2022 21:23:37 +0300

Download raw body.

Thread
This patch adds J and K bindings for diff view to move to the next and
previous commits respectively. It mimics keybindings which are found in
mutt while you're in mail view. I've found it very convenient, because
you can scroll diff with j/k and when you're done, don't move hands to
another part of a keyboard to see next/previous commit.

diff /home/misha/work/got
commit - d6267a62d388995cbc79bb58ce9db7946fda0554
path + /home/misha/work/got
blob - 4ec26b8962b911a5c478faf7aebc3d0686931d6e
file + tog/tog.1
--- tog/tog.1
+++ tog/tog.1
@@ -292,7 +292,7 @@ Scroll to the bottom of the view.
 Reduce diff context by N lines (default: 1).
 .It Cm \&]
 Increase diff context by N lines (default: 1).
-.It Cm <, Comma
+.It Cm <, Comma, K
 If the
 .Cm diff
 view was opened via the
@@ -302,7 +302,7 @@ If the diff was opened via the
 .Cm blame
 view, move to the Nth previous line and load the corresponding commit
 (default: 1).
-.It Cm >, Full stop
+.It Cm >, Full stop, J
 If the
 .Cm diff
 view was opened via the
blob - 97ac0690a9232815bb10bc4a237246e2ec53e069
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -4805,10 +4805,12 @@ input_diff_view(struct tog_view **new_view, struct tog
 		break;
 	case '<':
 	case ',':
+	case 'K':
 		up = 1;
 		/* FALL THROUGH */
 	case '>':
 	case '.':
+	case 'J':
 		if (s->parent_view == NULL) {
 			view->count = 0;
 			break;