summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-07-04 08:24:37 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-07-04 08:24:37 +0000
commit2d9bad0a94c4b17e3445098705ea870c3d1c1b33 (patch)
tree440f115d2fec9470273c382beda0f2293bc229a4 /usr.bin/tmux
parent0a3c788d83b3f2d8fbbbdcaa554a356129927714 (diff)
Mouse clicks could change current item, so work it out again. GitHub
issue 3242.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/window-tree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/window-tree.c b/usr.bin/tmux/window-tree.c
index c2c9b56c1da..fd3a9ab7a39 100644
--- a/usr.bin/tmux/window-tree.c
+++ b/usr.bin/tmux/window-tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-tree.c,v 1.60 2022/05/30 12:55:25 nicm Exp $ */
+/* $OpenBSD: window-tree.c,v 1.61 2022/07/04 08:24:36 nicm Exp $ */
/*
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1243,12 +1243,17 @@ window_tree_key(struct window_mode_entry *wme, struct client *c,
item = mode_tree_get_current(data->data);
finished = mode_tree_key(data->data, c, &key, m, &x, &y);
+
+again:
if (item != (new_item = mode_tree_get_current(data->data))) {
item = new_item;
data->offset = 0;
}
- if (KEYC_IS_MOUSE(key) && m != NULL)
+ if (KEYC_IS_MOUSE(key) && m != NULL) {
key = window_tree_mouse(data, key, x, item);
+ goto again;
+ }
+
switch (key) {
case '<':
data->offset--;