aboutsummaryrefslogtreecommitdiff
path: root/cmd-display-menu.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-03-28 10:01:27 +0000
committerThomas Adam <thomas@xteddy.org>2020-03-28 10:01:27 +0000
commit88ca50054695ce1447c48ba607f5a6fa1264dc41 (patch)
treeb6c8fd5dd72b06cab683e36b5af0e11429388528 /cmd-display-menu.c
parentf986539e3c1c8757d443ea61c9c155c36aae38d7 (diff)
parent4346098e977d8fb3bde0783e9858f3def7bc01a5 (diff)
downloadrtmux-88ca50054695ce1447c48ba607f5a6fa1264dc41.tar.gz
rtmux-88ca50054695ce1447c48ba607f5a6fa1264dc41.tar.bz2
rtmux-88ca50054695ce1447c48ba607f5a6fa1264dc41.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-display-menu.c')
-rw-r--r--cmd-display-menu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd-display-menu.c b/cmd-display-menu.c
index aafe2447..e12a24ab 100644
--- a/cmd-display-menu.c
+++ b/cmd-display-menu.c
@@ -237,7 +237,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
}
if (nlines != 0)
- h = nlines + 2;
+ h = popup_height(nlines, lines) + 2;
else
h = c->tty.sy / 2;
if (args_has(args, 'h')) {
@@ -262,6 +262,10 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
}
}
+ if (w > c->tty.sx - 1)
+ w = c->tty.sx - 1;
+ if (h > c->tty.sy - 1)
+ h = c->tty.sy - 1;
cmd_display_menu_get_position(c, item, args, &px, &py, w, h);
value = args_get(args, 'd');