Handle different borders in move-pane, from Dane Jensen.

This commit is contained in:
nicm
2026-06-24 08:52:15 +00:00
parent 8fb484da37
commit 0a71af41be

View File

@@ -203,24 +203,29 @@ cmd_join_pane_move(struct cmdq_item *item, struct args *args,
char *cause = NULL, flag; char *cause = NULL, flag;
int xoff = lc->xoff, yoff = lc->yoff, adjust; int xoff = lc->xoff, yoff = lc->yoff, adjust;
u_int i; u_int i;
enum pane_lines lines = window_pane_get_pane_lines(wp);
if (args_has(args, 'X')) { if (args_has(args, 'X')) {
xoff = args_percentage_and_expand(args, 'X', -(int)lc->sx, xoff = args_percentage_and_expand(args, 'X', -(int)w->sx,
w->sx, w->sx, item, &cause); w->sx, w->sx, item, &cause);
if (cause != NULL) { if (cause != NULL) {
cmdq_error(item, "position %s", cause); cmdq_error(item, "position %s", cause);
free(cause); free(cause);
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
if (lines != PANE_LINES_NONE)
xoff += 1;
} }
if (args_has(args, 'Y')) { if (args_has(args, 'Y')) {
yoff = args_percentage_and_expand(args, 'Y', -(int)lc->sy, yoff = args_percentage_and_expand(args, 'Y', -(int)w->sy,
w->sy, w->sy, item, &cause); w->sy, w->sy, item, &cause);
if (cause != NULL) { if (cause != NULL) {
cmdq_error(item, "position %s", cause); cmdq_error(item, "position %s", cause);
free(cause); free(cause);
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
if (lines != PANE_LINES_NONE)
yoff += 1;
} }
for (i = 0; i < nitems(flags); i++) { for (i = 0; i < nitems(flags); i++) {