diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-05-04 08:38:03 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-05-04 08:38:03 +0000 |
| commit | 29b697a9afeeea8a5f55c6adce1489a21e04ef8c (patch) | |
| tree | 83280fa265005aeac951de19b6194318aaee6726 /config.c | |
| parent | Merge branch 'add-truecolor-to-feature-list' (diff) | |
| parent | config: add ‘beam-thickness’ option (diff) | |
Merge branch 'beam-thickness'
Closes #464
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -941,13 +941,14 @@ parse_section_cursor(const char *key, const char *value, struct config *conf, if (strcmp(key, "style") == 0) { if (strcmp(value, "block") == 0) conf->cursor.style = CURSOR_BLOCK; - else if (strcmp(value, "bar") == 0) - conf->cursor.style = CURSOR_BAR; + else if (strcmp(value, "beam") == 0 || strcmp(value, "bar") == 0) + conf->cursor.style = CURSOR_BEAM; else if (strcmp(value, "underline") == 0) conf->cursor.style = CURSOR_UNDERLINE; else { - LOG_AND_NOTIFY_ERR("%s:%d: invalid 'style': %s", path, lineno, value); + LOG_AND_NOTIFY_ERR("%s:%d: style: one of block, beam or underline", + path, lineno); return false; } } @@ -967,6 +968,13 @@ parse_section_cursor(const char *key, const char *value, struct config *conf, conf->cursor.color.cursor |= 1u << 31; } + else if (strcmp(key, "beam-thickness") == 0) { + if (!str_to_pt_or_px( + value, &conf->cursor.beam_thickness, + conf, path, lineno, "cursor", "beam-thickness")) + return false; + } + else { LOG_AND_NOTIFY_ERR("%s:%d: [cursor]: %s: invalid key", path, lineno, key); return false; @@ -2261,6 +2269,7 @@ config_load(struct config *conf, const char *conf_path, .text = 0, .cursor = 0, }, + .beam_thickness = {.pt = 1.5}, }, .mouse = { .hide_when_typing = false, |
