diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-03-31 20:01:34 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-03-31 20:01:34 +0100 |
commit | dfd29977e0ab289615eae0b4275763a3082bda24 (patch) | |
tree | 9e1753f4e3748cddfce46356d57044fe7ba49bf0 /cmd-resize-pane.c | |
parent | 0bb1a50b88ac319e8f499fa95500f373123594d1 (diff) | |
parent | cc8b41f294974cdfb1ddfe3b907da58374ff130f (diff) | |
download | rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.gz rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.tar.bz2 rtmux-dfd29977e0ab289615eae0b4275763a3082bda24.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-resize-pane.c')
-rw-r--r-- | cmd-resize-pane.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index b0aa2756..fd303cc1 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -36,8 +36,8 @@ const struct cmd_entry cmd_resize_pane_entry = { .name = "resize-pane", .alias = "resizep", - .args = { "DLMRt:Ux:y:Z", 0, 1 }, - .usage = "[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " " + .args = { "DLMRTt:Ux:y:Z", 0, 1 }, + .usage = "[-DLMRTUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " " "[adjustment]", .target = { 't', CMD_FIND_PANE, 0 }, @@ -60,6 +60,19 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item) char *cause; u_int adjust; int x, y; + struct grid *gd = wp->base.grid; + + if (args_has(args, 'T')) { + if (!TAILQ_EMPTY(&wp->modes)) + return (CMD_RETURN_NORMAL); + adjust = screen_size_y(&wp->base) - 1 - wp->base.cy; + if (adjust > gd->hsize) + adjust = gd->hsize; + grid_remove_history(gd, adjust); + wp->base.cy += adjust; + wp->flags |= PANE_REDRAW; + return (CMD_RETURN_NORMAL); + } if (args_has(args, 'M')) { if (cmd_mouse_window(&shared->mouse, &s) == NULL) |