-/* $OpenBSD: cmd-resize-pane.c,v 1.51 2021/08/21 10:28:05 nicm Exp $ */
+/* $OpenBSD: cmd-resize-pane.c,v 1.52 2022/02/03 11:06:11 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
const char *errstr;
char *cause;
u_int adjust;
- int x, y;
+ int x, y, status;
struct grid *gd = wp->base.grid;
if (args_has(args, 'T')) {
free(cause);
return (CMD_RETURN_ERROR);
}
+ status = options_get_number(w->options, "pane-border-status");
+ switch (status) {
+ case PANE_STATUS_TOP:
+ if (y != INT_MAX && wp->yoff == 1)
+ y++;
+ break;
+ case PANE_STATUS_BOTTOM:
+ if (y != INT_MAX && wp->yoff + wp->sy == w->sy - 1)
+ y++;
+ break;
+ }
layout_resize_pane_to(wp, LAYOUT_TOPBOTTOM, y);
}