mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-18 22:05:25 -05:00
config: add cursor.unfocused-style
This option controls how we render the cursor when the terminal window is unfocused. Possible values are: * hollow: the default, and how we rendered the cursor before this patch. * unchanged: render the cursor exactly the same way as when the window is focused. * none: do not render any cursor at all Closes #1582
This commit is contained in:
parent
9287946b36
commit
e5a2ac4b57
6 changed files with 59 additions and 7 deletions
11
config.c
11
config.c
|
|
@ -1383,6 +1383,16 @@ parse_section_cursor(struct context *ctx)
|
|||
(int *)&conf->cursor.style);
|
||||
}
|
||||
|
||||
else if (streq(key, "unfocused-style")) {
|
||||
_Static_assert(sizeof(conf->cursor.unfocused_style) == sizeof(int),
|
||||
"enum is not 32-bit");
|
||||
|
||||
return value_to_enum(
|
||||
ctx,
|
||||
(const char *[]){"unchanged", "hollow", "none", NULL},
|
||||
(int *)&conf->cursor.unfocused_style);
|
||||
}
|
||||
|
||||
else if (streq(key, "blink"))
|
||||
return value_to_bool(ctx, &conf->cursor.blink);
|
||||
|
||||
|
|
@ -3090,6 +3100,7 @@ config_load(struct config *conf, const char *conf_path,
|
|||
|
||||
.cursor = {
|
||||
.style = CURSOR_BLOCK,
|
||||
.unfocused_style = CURSOR_UNFOCUSED_HOLLOW,
|
||||
.blink = false,
|
||||
.color = {
|
||||
.text = 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue