config: add url.style=none|single|double|curly|dotted|dashed

This option allows you to configure which underline style to use with
URLs.

The default is dotted. Since before this patch, URL underlines were
always plain underlines, this means the default URL underline style
has changed, from single to dotted.

Closes #2302
This commit is contained in:
Daniel Eklöf 2026-04-06 15:47:26 +02:00
parent ecf3b864e4
commit 2c454a71f1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 50 additions and 11 deletions

View file

@ -1304,6 +1304,14 @@ parse_section_url(struct context *ctx)
else if (streq(key, "label-letters"))
return value_to_wchars(ctx, &conf->url.label_letters);
else if (streq(key, "style")) {
_Static_assert(sizeof(conf->url.style) == sizeof(int),
"enum is not 32-bit");
return value_to_enum(
ctx, (const char *[]){"none", "single", "double", "curly", "dotted", "dashed", NULL},
(int *)&conf->url.style);
}
else if (streq(key, "osc8-underline")) {
_Static_assert(sizeof(conf->url.osc8_underline) == sizeof(int),
"enum is not 32-bit");
@ -3518,6 +3526,7 @@ config_load(struct config *conf, const char *conf_path,
.url = {
.label_letters = xc32dup(U"sadfjklewcmpgh"),
.osc8_underline = OSC8_UNDERLINE_URL_MODE,
.style = UNDERLINE_DOTTED,
},
.custom_regexes = tll_init(),
.can_shape_grapheme = fcft_caps & FCFT_CAPABILITY_GRAPHEME_SHAPING,