summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authornicm <nicm>2019-07-06 20:56:34 +0000
committernicm <nicm>2019-07-06 20:56:34 +0000
commitddf53d6e4e76463e6d777b2de7304572333935e9 (patch)
tree11195c56e3699e1a9dc8e96b2054ef4505770dda /cmd.c
parent3635b3cd6c3343b2ec3f7173facef8a284e7e613 (diff)
Correctly adjust mouse position if the status line is at the top and
more than one line. GitHub issue 1822.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index a071dec5..c838c53f 100644
--- a/cmd.c
+++ b/cmd.c
@@ -597,8 +597,8 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
}
log_debug("%s: x=%u, y=%u%s", __func__, x, y, last ? " (last)" : "");
- if (m->statusat == 0 && y > 0)
- y--;
+ if (m->statusat == 0 && y >= m->statuslines)
+ y -= m->statuslines;
if (x < wp->xoff || x >= wp->xoff + wp->sx)
return (-1);