Adjust size given to resize-pane for pane status line, GitHub issue
authornicm <nicm@openbsd.org>
Thu, 3 Feb 2022 11:06:11 +0000 (11:06 +0000)
committernicm <nicm@openbsd.org>
Thu, 3 Feb 2022 11:06:11 +0000 (11:06 +0000)
3050.

usr.bin/tmux/cmd-resize-pane.c

index 8223026..2366e92 100644 (file)
@@ -1,4 +1,4 @@
-/* $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>
@@ -60,7 +60,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
        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')) {
@@ -121,6 +121,17 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
                        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);
        }