summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-07-08 14:01:21 +0100
committerThomas Adam <thomas@xteddy.org>2021-07-08 14:01:21 +0100
commitc1d5dda62e30d3e778896a8aac0c372cda06fb69 (patch)
tree0b909087dc00d4321b650f6358eb95349da14c39
parented575182e3018d81a0b3b81bde4a64bad967c298 (diff)
parent51915b9b0ac0ac9a98e12c1a5781f34f492a4679 (diff)
Merge branch 'obsd-master' into master
-rw-r--r--cmd-display-menu.c2
-rw-r--r--format.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/cmd-display-menu.c b/cmd-display-menu.c
index de423e68..91a7aa4d 100644
--- a/cmd-display-menu.c
+++ b/cmd-display-menu.c
@@ -175,7 +175,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/format.c b/format.c
index 512df009..ec7914a0 100644
--- a/format.c
+++ b/format.c
@@ -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);