mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: refactor to allow setting only selection bg or fg
Before this, we only applied custom selection colors, if *both* the selection bg and fg had been set. Since the options are already split up into two separate options, and since it makes sense to at least be able to keep the foreground colors unchanged (i.e. only setting the selection background), let's allow only having one of the selection colors set. Closes #1846
This commit is contained in:
parent
c037836bbd
commit
073b637d45
8 changed files with 68 additions and 60 deletions
4
osc.c
4
osc.c
|
|
@ -1480,12 +1480,10 @@ osc_dispatch(struct terminal *term)
|
|||
|
||||
case 17:
|
||||
term->colors.selection_bg = color;
|
||||
term->colors.use_custom_selection = true;
|
||||
break;
|
||||
|
||||
case 19:
|
||||
term->colors.selection_fg = color;
|
||||
term->colors.use_custom_selection = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1589,13 +1587,11 @@ osc_dispatch(struct terminal *term)
|
|||
case 117:
|
||||
LOG_DBG("resetting selection background color");
|
||||
term->colors.selection_bg = term->conf->colors.selection_bg;
|
||||
term->colors.use_custom_selection = term->conf->colors.use_custom.selection;
|
||||
break;
|
||||
|
||||
case 119:
|
||||
LOG_DBG("resetting selection foreground color");
|
||||
term->colors.selection_fg = term->conf->colors.selection_fg;
|
||||
term->colors.use_custom_selection = term->conf->colors.use_custom.selection;
|
||||
break;
|
||||
|
||||
case 133:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue