mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
refactor: only reload colorscheme if &bg changed (#26598)
Currently, setting &bg at all re-initializes highlights and reloads the active colorscheme, even if the actual value of &bg has not changed. With https://github.com/neovim/neovim/pull/26595 this causes a regression since &bg is set unconditionally based on the value detected from the terminal. Instead, only reload the colorscheme if the actual value of &bg has changed.
This commit is contained in:
@@ -663,12 +663,17 @@ int expand_set_ambiwidth(optexpand_T *args, int *numMatches, char ***matches)
|
||||
}
|
||||
|
||||
/// The 'background' option is changed.
|
||||
const char *did_set_background(optset_T *args FUNC_ATTR_UNUSED)
|
||||
const char *did_set_background(optset_T *args)
|
||||
{
|
||||
if (check_opt_strings(p_bg, p_bg_values, false) != OK) {
|
||||
return e_invarg;
|
||||
}
|
||||
|
||||
if (args->os_oldval.string.data[0] == *p_bg) {
|
||||
// Value was not changed
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dark = (*p_bg == 'd');
|
||||
|
||||
init_highlight(false, false);
|
||||
|
Reference in New Issue
Block a user