From c2b9e1d8c00cf2bb3c05493809fc1255d7e2d4a5 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 1 Nov 2022 09:46:14 +0000 Subject: [PATCH] Use active pane in target window not current window for +/-. GitHub issue 3370. --- usr.bin/tmux/cmd-find.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 1e5a26a4b3f..e7cb49a1b4d 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.81 2022/07/06 08:32:28 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.82 2022/11/01 09:46:14 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -588,22 +588,22 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) return (-1); return (0); } else if (strcmp(pane, "{up-of}") == 0) { - fs->wp = window_pane_find_up(fs->current->wp); + fs->wp = window_pane_find_up(fs->w->active); if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{down-of}") == 0) { - fs->wp = window_pane_find_down(fs->current->wp); + fs->wp = window_pane_find_down(fs->w->active); if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{left-of}") == 0) { - fs->wp = window_pane_find_left(fs->current->wp); + fs->wp = window_pane_find_left(fs->w->active); if (fs->wp == NULL) return (-1); return (0); } else if (strcmp(pane, "{right-of}") == 0) { - fs->wp = window_pane_find_right(fs->current->wp); + fs->wp = window_pane_find_right(fs->w->active); if (fs->wp == NULL) return (-1); return (0); @@ -615,7 +615,7 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) n = strtonum(pane + 1, 1, INT_MAX, NULL); else n = 1; - wp = fs->current->wp; + wp = fs->w->active; if (pane[0] == '+') fs->wp = window_pane_next_by_number(fs->w, wp, n); else -- 2.20.1