From 1b5c8499947b2bb9fa9fe17af6540444984a5949 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 18 May 2021 18:52:10 +0200 Subject: config: add cursor.underline-thickness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Works in pretty much the same way as ‘beam-thickness’, except that the default value is “the font’s underline thickness”. This means, that when unset, the cursor underline thickness scales with the font size. But, when explicitly set, either to a point size value, or a pixel size, it remains fixed at that size. Closes #524 --- config.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'config.c') diff --git a/config.c b/config.c index 7159d299..563130a7 100644 --- a/config.c +++ b/config.c @@ -1059,6 +1059,13 @@ parse_section_cursor(const char *key, const char *value, struct config *conf, return false; } + else if (strcmp(key, "underline-thickness") == 0) { + if (!str_to_pt_or_px( + value, &conf->cursor.underline_thickness, + conf, path, lineno, "cursor", "underline-thickness")) + return false; + } + else { LOG_AND_NOTIFY_ERR("%s:%d: [cursor]: %s: invalid key", path, lineno, key); return false; @@ -2373,6 +2380,7 @@ config_load(struct config *conf, const char *conf_path, .cursor = 0, }, .beam_thickness = {.pt = 1.5}, + .underline_thickness = {.pt = 0., .px = -1}, }, .mouse = { .hide_when_typing = false, -- cgit v1.3