diff --git a/format.c b/format.c index 42f80f6f..010e8462 100644 --- a/format.c +++ b/format.c @@ -5343,9 +5343,8 @@ format_grid_word(struct grid *gd, u_int x, u_int y) for (;;) { grid_get_cell(gd, x, y, &gc); - if (gc.flags & GRID_FLAG_PADDING) - break; - if (format_is_word_separator(ws, &gc)) { + if ((~gc.flags & GRID_FLAG_PADDING) && + format_is_word_separator(ws, &gc)) { found = 1; break; } @@ -5381,7 +5380,7 @@ 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; + continue; if (format_is_word_separator(ws, &gc)) break; diff --git a/window-copy.c b/window-copy.c index 1dd12e45..809c2402 100644 --- a/window-copy.c +++ b/window-copy.c @@ -869,9 +869,9 @@ window_copy_get_word(struct window_pane *wp, u_int x, u_int y) { struct window_mode_entry *wme = TAILQ_FIRST(&wp->modes); struct window_copy_mode_data *data = wme->data; - struct grid *gd = data->screen.grid; + struct grid *gd = data->backing->grid; - return (format_grid_word(gd, x, gd->hsize + y)); + return (format_grid_word(gd, x, gd->hsize + y - data->oy)); } char *