Skip to content

Commit f53fb9f

Browse files
author
tcunha
committed
Sync OpenBSD patchset 144:
Move the offsets as well when swapping panes.
1 parent d1d98db commit f53fb9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cmd-swap-pane.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $ */
22

33
/*
44
* Copyright (c) 2009 Nicholas Marriott <[email protected]>
@@ -158,7 +158,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
158158
struct window *w;
159159
struct window_pane *tmp_wp, *src_wp, *dst_wp;
160160
struct layout_cell *lc;
161-
u_int xx, yy;
161+
u_int sx, sy, xoff, yoff;
162162

163163
if (data == NULL)
164164
return (0);
@@ -209,19 +209,19 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
209209
TAILQ_INSERT_AFTER(&w->panes, tmp_wp, src_wp, entry);
210210

211211
lc = src_wp->layout_cell;
212-
xx = src_wp->xoff;
213-
yy = src_wp->yoff;
214212
src_wp->layout_cell = dst_wp->layout_cell;
215213
if (src_wp->layout_cell != NULL)
216214
src_wp->layout_cell->wp = src_wp;
217215
dst_wp->layout_cell = lc;
218216
if (dst_wp->layout_cell != NULL)
219217
dst_wp->layout_cell->wp = dst_wp;
220218

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;
223222
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);
225225

226226
if (!data->flag_detached) {
227227
tmp_wp = dst_wp;

0 commit comments

Comments
 (0)