diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2022-06-16 13:27:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2022-06-16 13:27:40 +0000 |
commit | a9a9f55e2945dfa5a64aca511fdc22166bec4472 (patch) | |
tree | dcc7099933ad006a34a65f558294fb96f02d70ee /usr.bin/tmux/menu.c | |
parent | 92c46cd041e33f875b8f262b229c936ade41434a (diff) |
Keep cursor on selected item on menu (useful for blind people), GitHub
issue 3225.
Diffstat (limited to 'usr.bin/tmux/menu.c')
-rw-r--r-- | usr.bin/tmux/menu.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index bfb5175b9cb..2b379a2553b 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.45 2022/05/31 10:22:42 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.46 2022/06/16 13:27:39 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -160,11 +160,16 @@ menu_free(struct menu *menu) } struct screen * -menu_mode_cb(__unused struct client *c, void *data, __unused u_int *cx, - __unused u_int *cy) +menu_mode_cb(__unused struct client *c, void *data, u_int *cx, u_int *cy) { struct menu_data *md = data; + *cx = md->px + 2; + if (md->choice == -1) + *cy = md->py; + else + *cy = md->py + 1 + md->choice; + return (&md->s); } |