shithub: orca

Download patch

ref: cdeb13f59a9fcbc0c9a81bfd99678aa16ea3dabd
parent: e95728d892e8e0e89ac8528329368e3c1d3d5105
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Feb 23 18:46:16 EST 2020

plan9: holding alt with left mouse button moves the selection to the clicked cell

--- a/plan9.c
+++ b/plan9.c
@@ -1159,6 +1159,7 @@
 	Keyboardctl kctl;
 	Rune r;
 	Mouse m;
+	Point p;
 	char tmp[256];
 	int oldw, oldh, w, h, n, oldbuttons;
 	long seed;
@@ -1314,7 +1315,14 @@
 
 		case Cmouse:
 			if (m.buttons == 1) {
-				if (oldbuttons == 0 && !shiftdown) {
+				if (altdown) {
+					p = ptmouse(m.xy);
+					if (!eqpt(p, cur)) {
+						snapshot();
+						selmove(p.x-cur.x, p.y-cur.y);
+						curmove(p.x-cur.x, p.y-cur.y);
+					}
+				} else if (oldbuttons == 0 && !shiftdown) {
 					cur = ptmouse(m.xy);
 					sel.min = cur;
 					sel.max = cur;