From: nicm Date: Mon, 4 Jul 2022 08:24:36 +0000 (+0000) Subject: Mouse clicks could change current item, so work it out again. GitHub X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba7a0894c37fd7e94953f867d60f7b58c8db052c;p=openbsd Mouse clicks could change current item, so work it out again. GitHub issue 3242. --- 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 @@ -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--;