summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-rotate-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-08-14 09:58:31 +0000
committernicm <nicm@openbsd.org>2019-08-14 09:58:31 +0000
commit721430b8288e74bbeac1cb8345e4ce56de62f552 (patch)
tree67b171c39b7eabc763236a820fe12b1917d4b8d4 /usr.bin/tmux/cmd-rotate-window.c
parentFix NAT traversal detection bug when "local" option is not explicitly (diff)
downloadwireguard-openbsd-721430b8288e74bbeac1cb8345e4ce56de62f552.tar.xz
wireguard-openbsd-721430b8288e74bbeac1cb8345e4ce56de62f552.zip
Add -Z flag to rotate-window, select-pane, swap-pane, switch-client to
preserve zoomed state. GitHub issue 1839.
Diffstat (limited to 'usr.bin/tmux/cmd-rotate-window.c')
-rw-r--r--usr.bin/tmux/cmd-rotate-window.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-rotate-window.c b/usr.bin/tmux/cmd-rotate-window.c
index 433605a1622..0625902d740 100644
--- a/usr.bin/tmux/cmd-rotate-window.c
+++ b/usr.bin/tmux/cmd-rotate-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-rotate-window.c,v 1.26 2019/04/17 14:37:48 nicm Exp $ */
+/* $OpenBSD: cmd-rotate-window.c,v 1.27 2019/08/14 09:58:31 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -31,8 +31,8 @@ const struct cmd_entry cmd_rotate_window_entry = {
.name = "rotate-window",
.alias = "rotatew",
- .args = { "Dt:U", 0, 0 },
- .usage = "[-DU] " CMD_TARGET_WINDOW_USAGE,
+ .args = { "Dt:UZ", 0, 0 },
+ .usage = "[-DUZ] " CMD_TARGET_WINDOW_USAGE,
.target = { 't', CMD_FIND_WINDOW, 0 },
@@ -50,7 +50,7 @@ cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item)
struct layout_cell *lc;
u_int sx, sy, xoff, yoff;
- server_unzoom_window(w);
+ window_push_zoom(w, args_has(self->args, 'Z'));
if (args_has(self->args, 'D')) {
wp = TAILQ_LAST(&w->panes, window_panes);
@@ -77,9 +77,6 @@ cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item)
if ((wp = TAILQ_PREV(w->active, window_panes, entry)) == NULL)
wp = TAILQ_LAST(&w->panes, window_panes);
- window_set_active_pane(w, wp, 1);
- cmd_find_from_winlink_pane(current, wl, wp, 0);
- server_redraw_window(w);
} else {
wp = TAILQ_FIRST(&w->panes);
TAILQ_REMOVE(&w->panes, wp, entry);
@@ -105,10 +102,12 @@ cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item)
if ((wp = TAILQ_NEXT(w->active, entry)) == NULL)
wp = TAILQ_FIRST(&w->panes);
- window_set_active_pane(w, wp, 1);
- cmd_find_from_winlink_pane(current, wl, wp, 0);
- server_redraw_window(w);
}
+ window_set_active_pane(w, wp, 1);
+ cmd_find_from_winlink_pane(current, wl, wp, 0);
+ window_pop_zoom(w);
+ server_redraw_window(w);
+
return (CMD_RETURN_NORMAL);
}