urls: OSC-8 URLs can now optionally be underlined outside of url-mode

This patch adds a new configuration option,
‘osc8-underline=url-mode|always’.

When set to ‘url-mode’, OSC-8 URLs are only
highlighted (i.e. underlined) in url-mode, just like auto-detected
URLs.

When set to ‘always’, they are always underlined, regardless of mode,
and regardless of their other attributes.

This is implemented by tagging collected URLs with a boolean,
instructing urls_render() and urls_reset() whether they should update
the cells’ ‘url’ attribute or not.

The OSC-8 collecter sets this based on the value of ‘osc8-underline’.

Finally, when closing an OSC-8 URL, the cells are immediately tagged
with the ‘url’ attribute if ‘osc8-underline’ is set to ‘always’.
This commit is contained in:
Daniel Eklöf 2021-02-14 21:29:22 +01:00
parent a0b977fcee
commit 2074f8b656
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
7 changed files with 65 additions and 3 deletions

View file

@ -256,6 +256,7 @@ struct url {
struct coord start;
struct coord end;
enum url_action action;
bool url_mode_dont_change_url_attr; /* Entering/exiting URL mode doesnt touch the cells attr.url */
};
typedef tll(struct url) url_list_t;