ref: 528348b9001de1db8461c81137bdee1615e3da5a
parent: f124962fa0072163bfdef1149a17cad16da13506
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Feb 17 10:53:55 EST 2020
plan9: cut/paste with mouse
--- a/plan9.c
+++ b/plan9.c
@@ -63,6 +63,8 @@
Rune rune;
};
+int mainstacksize = 32768;
+
static int bpm = 120, apm = 120;
static Point rulers = {8, 8};
static int rulerstyle = Sfancy, dotstyle = Sfancy;
@@ -971,8 +973,18 @@
else
sel.min.y = cur.y;
}
- } else if (m.buttons == 4) {
+ break;
+ }
+ if (m.buttons == 0)
mselecting = false;
+
+ if (m.buttons == 3) { /* cut */
+ selcopy();
+ selset('.');
+ } else if (m.buttons == 5) { /* paste */
+ selpaste();
+ mselecting = false;
+ } else if (m.buttons == 4) { /* menu */
menu3i[Menu3dotstyle] = tmp;
menu3i[Menu3rulerstyle] = 1 + menu3i[Menu3dotstyle] + sprintf(tmp, "%s dots", style[(dotstyle+1) % Numstyles]);
sprintf(menu3i[Menu3rulerstyle], "%s rulers", style[(rulerstyle+1) % Numstyles]);
@@ -996,8 +1008,6 @@
goto end;
}
complete = true;
- } else if (mselecting) {
- mselecting = false;
} else {
goto noredraw;
}