summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-07-08 11:14:54 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-07-08 11:14:54 +0000
commit35ed1380706314aef787867332ebe2b4a4b41256 (patch)
treeffbdc66aa5600d1f7d0a06f9f4e02e7c13df4291 /usr.bin/tmux
parent262dd9fb2aa1d80fcfa7d692fc19c7b45ef55bdb (diff)
Fix mouse_word format now word-separators has no space and position of
menu if too close to the bottom.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-display-menu.c4
-rw-r--r--usr.bin/tmux/format.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c
index aeaffbb45a5..2e984202bb2 100644
--- a/usr.bin/tmux/cmd-display-menu.c
+++ b/usr.bin/tmux/cmd-display-menu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-display-menu.c,v 1.24 2021/06/10 07:22:06 nicm Exp $ */
+/* $OpenBSD: cmd-display-menu.c,v 1.25 2021/07/08 11:14:53 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -176,7 +176,7 @@ cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item,
format_add(ft, "popup_mouse_centre_y", "%ld", n);
n = (long)event->m.y + h;
if (n + h >= tty->sy)
- format_add(ft, "popup_mouse_top", "%u", tty->sy - h);
+ format_add(ft, "popup_mouse_top", "%u", tty->sy - 1);
else
format_add(ft, "popup_mouse_top", "%ld", n);
n = event->m.y - h;
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index a9d6ac9cb77..c701323d01c 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.286 2021/06/10 07:58:08 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.287 2021/07/08 11:14:53 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -4809,7 +4809,8 @@ format_grid_word(struct grid *gd, u_int x, u_int y)
grid_get_cell(gd, x, y, &gc);
if (gc.flags & GRID_FLAG_PADDING)
break;
- if (utf8_cstrhas(ws, &gc.data)) {
+ if (utf8_cstrhas(ws, &gc.data) ||
+ (gc.data.size == 1 && *gc.data.data == ' ')) {
found = 1;
break;
}
@@ -4846,7 +4847,8 @@ format_grid_word(struct grid *gd, u_int x, u_int y)
grid_get_cell(gd, x, y, &gc);
if (gc.flags & GRID_FLAG_PADDING)
break;
- if (utf8_cstrhas(ws, &gc.data))
+ if (utf8_cstrhas(ws, &gc.data) ||
+ (gc.data.size == 1 && *gc.data.data == ' '))
break;
ud = xreallocarray(ud, size + 2, sizeof *ud);