summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/menu.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-03-20 17:26:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-03-20 17:26:15 +0000
commit7621eb94b9853845c5f8e5ea2b9c578381e64bcf (patch)
treecf2520dd632e10f3bacffaee31f55641f1d62bd9 /usr.bin/tmux/menu.c
parent7e0b32f0456d67a9052fe44a1c5985b64535d66d (diff)
Fix positioning of menu in choose modes and a couple of keys in tree mode.
Diffstat (limited to 'usr.bin/tmux/menu.c')
-rw-r--r--usr.bin/tmux/menu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c
index 1254d2c781d..e7ab42fba81 100644
--- a/usr.bin/tmux/menu.c
+++ b/usr.bin/tmux/menu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: menu.c,v 1.13 2020/03/19 14:23:58 nicm Exp $ */
+/* $OpenBSD: menu.c,v 1.14 2020/03/20 17:26:14 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -295,6 +295,10 @@ menu_display(struct menu *menu, int flags, struct cmdq_item *item, u_int px,
if (c->tty.sx < menu->width + 4 || c->tty.sy < menu->count + 2)
return (-1);
+ if (px + menu->width + 4 > c->tty.sx)
+ px = c->tty.sx - menu->width - 4;
+ if (py + menu->count + 2 > c->tty.sy)
+ py = c->tty.sy - menu->count - 2;
md = xcalloc(1, sizeof *md);
md->item = item;