1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-05 07:38:49 +00:00

Correctly skip wide characters in hyperlinks, from someone in GitHub

issue 4425.
This commit is contained in:
nicm 2025-03-24 20:17:24 +00:00
parent 34a35b0f09
commit 483b2b3edb

View File

@ -5428,9 +5428,14 @@ format_grid_hyperlink(struct grid *gd, u_int x, u_int y, struct screen* s)
const char *uri;
struct grid_cell gc;
grid_get_cell(gd, x, y, &gc);
if (gc.flags & GRID_FLAG_PADDING)
return (NULL);
for (;;) {
grid_get_cell(gd, x, y, &gc);
if (~gc.flags & GRID_FLAG_PADDING)
break;
if (x == 0)
return (NULL);
x--;
}
if (s->hyperlinks == NULL || gc.link == 0)
return (NULL);
if (!hyperlinks_get(s->hyperlinks, gc.link, &uri, NULL, NULL))