-*options.txt* For Vim version 9.1. Last change: 2023 Dec 20
+*options.txt* For Vim version 9.1. Last change: 2024 Jan 03
VIM REFERENCE MANUAL by Bram Moolenaar
what the background color looks like. For changing the background
color, see |:hi-normal|.
- When 'background' is set Vim will adjust the default color groups for
- the new value. But the colors used for syntax highlighting will not
- change. *g:colors_name*
+ When 'background' is changed Vim will adjust the default color groups
+ for the new value. But the colors used for syntax highlighting will
+ not change. *g:colors_name*
When a color scheme is loaded (the "g:colors_name" variable is set)
- setting 'background' will cause the color scheme to be reloaded. If
+ changing 'background' will cause the color scheme to be reloaded. If
the color scheme adjusts to the value of 'background' this will work.
However, if the color scheme sets 'background' itself the effect may
be undone. First delete the "g:colors_name" variable when needed.
* The 'background' option is changed.
*/
char *
-did_set_background(optset_T *args UNUSED)
+did_set_background(optset_T *args)
{
if (check_opt_strings(p_bg, p_bg_values, FALSE) == FAIL)
return e_invalid_argument;
+ if (args->os_oldval.string != NULL && args->os_oldval.string[0] == *p_bg)
+ // Value was not changed
+ return NULL;
+
#ifdef FEAT_EVAL
int dark = (*p_bg == 'd');
#endif