shithub: orca

Download patch

ref: 27321464a0228c2bc747b6ce873eb2031d4a46b4
parent: 466ac5884f6ad22815d66c14f418186824b4a217
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Feb 15 18:03:42 EST 2020

plan9: fix C-hjkl

--- a/plan9.c
+++ b/plan9.c
@@ -666,7 +666,8 @@
 	Mouse m;
 	char tmp[256];
 	Channel *kchan;
-	int oldw, oldh, w, h, n, shiftdown, complete, movex, movey;
+	int oldw, oldh, w, h, n, shiftdown, complete;
+	int movex, movey, ctldown;
 	Alt a[Numchan+1] = {
 		[Cchar] = { nil, &key.rune, CHANRCV },
 		[Ckey] = { nil, &key, CHANRCV },
@@ -780,8 +781,9 @@
 				altdown = key.down;
 				break;
 			case Kctl:
-				movex = key.down ? gridw : 1;
-				movey = key.down ? gridh : 1;
+				ctldown = key.down;
+				movex = ctldown ? gridw : 1;
+				movey = ctldown ? gridh : 1;
 				break;
 			case Kup:
 			case Kdown:
@@ -800,6 +802,7 @@
 		case Cchar:
 			switch (key.rune) {
 			case 0x0b: /* C-k */
+				movey = 1;
 			case Kup:
 				if (shiftdown || mode == Mselect)
 					selh = MAX(1, selh-movey);
@@ -810,6 +813,7 @@
 				}
 				break;
 			case '\n': /* C-j */
+				movey = 1;
 			case Kdown:
 				if (shiftdown || mode == Mselect)
 					selh += movey;
@@ -820,6 +824,7 @@
 				}
 				break;
 			case Kbs: /* C-h */
+				movex = 1;
 			case Kleft:
 				if (shiftdown || mode == Mselect)
 					selw = MAX(1, selw-movex);
@@ -830,6 +835,7 @@
 				}
 				break;
 			case 0x0c: /* C-l */
+				movex = 1;
 				if (shiftdown) { /* FIXME this conflicts with vim keys btw */
 					selmap(tolower);
 					break;