aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-04-20 05:16:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-26 08:46:39 +0000
commit624c383a1f45a4fbd5ebf687613c509e6c22d909 (patch)
tree8e756d919e0e0d7e937cc3552ebafad1c7c8b6d6 /config.c
parentconfig: refactor: break out 'colors' to a color_theme struct (diff)
config: move cursor.color to colors.cursor
Diffstat (limited to 'config.c')
-rw-r--r--config.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/config.c b/config.c
index 347cc1ec..4337d001 100644
--- a/config.c
+++ b/config.c
@@ -1445,6 +1445,20 @@ parse_section_colors(struct context *ctx)
return true;
}
+ else if (streq(key, "cursor")) {
+ if (!value_to_two_colors(
+ ctx,
+ &conf->colors.cursor.text,
+ &conf->colors.cursor.cursor,
+ false))
+ {
+ return false;
+ }
+
+ conf->colors.use_custom.cursor = true;
+ return true;
+ }
+
else if (streq(key, "urls")) {
if (!value_to_color(ctx, &conf->colors.url, false))
return false;
@@ -1537,17 +1551,24 @@ parse_section_cursor(struct context *ctx)
return value_to_uint32(ctx, 10, &conf->cursor.blink.rate_ms);
else if (streq(key, "color")) {
+ LOG_WARN("%s:%d: cursor.color: deprecated; use colors.cursor instead",
+ ctx->path, ctx->lineno);
+
+ user_notification_add(
+ &conf->notifications,
+ USER_NOTIFICATION_DEPRECATED,
+ xstrdup("cursor.color: use colors.cursor instead"));
+
if (!value_to_two_colors(
- ctx,
- &conf->cursor.color.text,
- &conf->cursor.color.cursor,
- false))
+ ctx,
+ &conf->colors.cursor.text,
+ &conf->colors.cursor.cursor,
+ false))
{
return false;
}
- conf->cursor.color.text |= 1u << 31;
- conf->cursor.color.cursor |= 1u << 31;
+ conf->colors.use_custom.cursor = true;
return true;
}
@@ -3356,6 +3377,10 @@ config_load(struct config *conf, const char *conf_path,
.alpha_mode = ALPHA_MODE_DEFAULT,
.selection_fg = 0x80000000, /* Use default bg */
.selection_bg = 0x80000000, /* Use default fg */
+ .cursor = {
+ .text = 0,
+ .cursor = 0,
+ },
.use_custom = {
.selection = false,
.jump_label = false,
@@ -3371,10 +3396,6 @@ config_load(struct config *conf, const char *conf_path,
.enabled = false,
.rate_ms = 500,
},
- .color = {
- .text = 0,
- .cursor = 0,
- },
.beam_thickness = {.pt = 1.5},
.underline_thickness = {.pt = 0., .px = -1},
},