History

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

Sigrid Haflínudóttir committed 6 years ago

Commit cdeb13f1 parent e95728d1 file · +9 −1Browse files

Unified · Split

plan9.c+9−1
@@ -1159,6 +1159,7 @@ threadmain(int argc, char **argv) · 1158 unmodified lines
11591159 Keyboardctl kctl;
11601160 Rune r;
11611161 Mouse m;
1162+ Point p;
11621163 char tmp[256];
11631164 int oldw, oldh, w, h, n, oldbuttons;
11641165 long seed;
@@ -1314,7 +1315,14 @@ noredraw: · 149 unmodified lines
13141315
13151316 case Cmouse:
13161317 if (m.buttons == 1) {
1317− if (oldbuttons == 0 && !shiftdown) {
1318+ if (altdown) {
1319+ p = ptmouse(m.xy);
1320+ if (!eqpt(p, cur)) {
1321+ snapshot();
1322+ selmove(p.x-cur.x, p.y-cur.y);
1323+ curmove(p.x-cur.x, p.y-cur.y);
1324+ }
1325+ } else if (oldbuttons == 0 && !shiftdown) {
13181326 cur = ptmouse(m.xy);
13191327 sel.min = cur;
13201328 sel.max = cur;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t