|
1 |
| -/* $Id: cmd-swap-pane.c,v 1.9 2009-07-20 15:42:05 tcunha Exp $ */ |
| 1 | +/* $Id: cmd-swap-pane.c,v 1.10 2009-07-20 15:48:54 tcunha Exp $ */ |
2 | 2 |
|
3 | 3 | /*
|
4 | 4 | * Copyright (c) 2009 Nicholas Marriott <[email protected]>
|
@@ -158,7 +158,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
158 | 158 | struct window *w;
|
159 | 159 | struct window_pane *tmp_wp, *src_wp, *dst_wp;
|
160 | 160 | struct layout_cell *lc;
|
161 |
| - u_int xx, yy; |
| 161 | + u_int sx, sy, xoff, yoff; |
162 | 162 |
|
163 | 163 | if (data == NULL)
|
164 | 164 | return (0);
|
@@ -209,19 +209,19 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
|
209 | 209 | TAILQ_INSERT_AFTER(&w->panes, tmp_wp, src_wp, entry);
|
210 | 210 |
|
211 | 211 | lc = src_wp->layout_cell;
|
212 |
| - xx = src_wp->xoff; |
213 |
| - yy = src_wp->yoff; |
214 | 212 | src_wp->layout_cell = dst_wp->layout_cell;
|
215 | 213 | if (src_wp->layout_cell != NULL)
|
216 | 214 | src_wp->layout_cell->wp = src_wp;
|
217 | 215 | dst_wp->layout_cell = lc;
|
218 | 216 | if (dst_wp->layout_cell != NULL)
|
219 | 217 | dst_wp->layout_cell->wp = dst_wp;
|
220 | 218 |
|
221 |
| - xx = src_wp->sx; |
222 |
| - yy = src_wp->sy; |
| 219 | + sx = src_wp->sx; sy = src_wp->sy; |
| 220 | + xoff = src_wp->xoff; yoff = src_wp->yoff; |
| 221 | + src_wp->xoff = dst_wp->xoff; src_wp->yoff = dst_wp->yoff; |
223 | 222 | window_pane_resize(src_wp, dst_wp->sx, dst_wp->sy);
|
224 |
| - window_pane_resize(dst_wp, xx, yy); |
| 223 | + dst_wp->xoff = xoff; dst_wp->yoff = yoff; |
| 224 | + window_pane_resize(dst_wp, sx, sy); |
225 | 225 |
|
226 | 226 | if (!data->flag_detached) {
|
227 | 227 | tmp_wp = dst_wp;
|
|
0 commit comments