summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2022-09-20 08:29:49 -0400
committerLuke Smith <luke@lukesmith.xyz>2022-09-20 08:29:49 -0400
commit4c57f1f61861c28e1cca9a9ae5aa16b8fbf9da1e (patch)
treeb60d439ca72eb62a7b309e327728047c95f4f3ad
parent401b6f73f0ebfa3c834c649820048d2d1d678284 (diff)
vim mouse clicking fixed, fix #344
-rw-r--r--x.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/x.c b/x.c
index b5405ed..e2ec9db 100644
--- a/x.c
+++ b/x.c
@@ -410,7 +410,6 @@ mousesel(XEvent *e, int done)
void
mousereport(XEvent *e)
{
- int code;
int len, x = evcol(e), y = evrow(e),
button = e->xbutton.button, state = e->xbutton.state;
char buf[40];
@@ -459,11 +458,11 @@ mousereport(XEvent *e)
if (IS_SET(MODE_MOUSESGR)) {
len = snprintf(buf, sizeof(buf), "\033[<%d;%d;%d%c",
- code, x+1, y+1,
+ button, x+1, y+1,
e->type == ButtonRelease ? 'm' : 'M');
} else if (x < 223 && y < 223) {
len = snprintf(buf, sizeof(buf), "\033[M%c%c%c",
- 32+code, 32+x+1, 32+y+1);
+ 32+button, 32+x+1, 32+y+1);
} else {
return;
}