diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-20 07:13:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-20 07:13:32 +0000 |
commit | ef771a12f488014f2be90f7b7b99725395a4a0d9 (patch) | |
tree | 0624db1472efbf53036a05eccc8978e27079098a /usr.bin/tmux | |
parent | f1af1a808d8a5f74f2d882427675fda06443fb1c (diff) |
Move the offsets as well when swapping panes.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-swap-pane.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-swap-pane.c b/usr.bin/tmux/cmd-swap-pane.c index 2100ba4a188..bcc03be7ebe 100644 --- a/usr.bin/tmux/cmd-swap-pane.c +++ b/usr.bin/tmux/cmd-swap-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-swap-pane.c,v 1.5 2009/07/19 13:21:40 nicm Exp $ */ +/* $OpenBSD: cmd-swap-pane.c,v 1.6 2009/07/20 07:13:31 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -158,7 +158,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx) struct window *w; struct window_pane *tmp_wp, *src_wp, *dst_wp; struct layout_cell *lc; - u_int xx, yy; + u_int sx, sy, xoff, yoff; if (data == NULL) return (0); @@ -209,8 +209,6 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx) TAILQ_INSERT_AFTER(&w->panes, tmp_wp, src_wp, entry); lc = src_wp->layout_cell; - xx = src_wp->xoff; - yy = src_wp->yoff; src_wp->layout_cell = dst_wp->layout_cell; if (src_wp->layout_cell != NULL) src_wp->layout_cell->wp = src_wp; @@ -218,10 +216,12 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx) if (dst_wp->layout_cell != NULL) dst_wp->layout_cell->wp = dst_wp; - xx = src_wp->sx; - yy = src_wp->sy; + sx = src_wp->sx; sy = src_wp->sy; + xoff = src_wp->xoff; yoff = src_wp->yoff; + src_wp->xoff = dst_wp->xoff; src_wp->yoff = dst_wp->yoff; window_pane_resize(src_wp, dst_wp->sx, dst_wp->sy); - window_pane_resize(dst_wp, xx, yy); + dst_wp->xoff = xoff; dst_wp->yoff = yoff; + window_pane_resize(dst_wp, sx, sy); if (!data->flag_detached) { tmp_wp = dst_wp; |