Support hyperlinks with capture-pane -e and add a mouse_hyperlink

format, GitHub issue 3247 from Jeff Chiang.
This commit is contained in:
nicm
2022-07-06 07:36:36 +00:00
parent 9360e0ef32
commit d0d2c39dec
9 changed files with 118 additions and 16 deletions

View File

@ -179,7 +179,7 @@ hyperlinks_put(struct hyperlinks *hl, const char *uri_in,
/* Get hyperlink by inner number. */
int
hyperlinks_get(struct hyperlinks *hl, u_int inner, const char **uri_out,
const char **external_id_out)
const char **internal_id_out, const char **external_id_out)
{
struct hyperlinks_uri find, *hlu;
@ -188,7 +188,10 @@ hyperlinks_get(struct hyperlinks *hl, u_int inner, const char **uri_out,
hlu = RB_FIND(hyperlinks_by_inner_tree, &hl->by_inner, &find);
if (hlu == NULL)
return (0);
*external_id_out = hlu->external_id;
if (internal_id_out != NULL)
*internal_id_out = hlu->internal_id;
if (external_id_out != NULL)
*external_id_out = hlu->external_id;
*uri_out = hlu->uri;
return (1);
}