diff options
author | Gregory Anders <greg@gpanders.com> | 2024-01-03 19:48:51 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-01-03 19:53:59 +0100 |
commit | 83ad2726ff56db70cb2da78e1e4ea0e09941c73b (patch) | |
tree | 6e44818e2a9b2ee86b100ea888e7d4c99f136f3c /src | |
parent | 443657b32becb2318ae40e30a849bbe5cc1a153c (diff) |
patch 9.1.0004: reloading colorscheme when not changing 'background'v9.1.0004
Problem: reloading colorscheme when not changing 'background'
Solution: Check, if the background option value actually changed,
if not, return early.
Only reload colorscheme when bg is changed
Currently the highlight groups are re-initialized and the colorscheme
(if any) is reloaded anytime 'background' is set, even if it is not
changed. This is unnecessary, because if the value was not changed then
there is no need to change highlight groups or do anything with the
colorscheme. Instead, only reload the colorscheme if the value of
'background' was actually changed.
closes: #13700
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/optionstr.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/optionstr.c b/src/optionstr.c index 326e625526..65a80afe1a 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -1050,11 +1050,15 @@ expand_set_ambiwidth(optexpand_T *args, int *numMatches, char_u ***matches) * 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 diff --git a/src/version.c b/src/version.c index 749d6af13a..e83654fd56 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4, +/**/ 3, /**/ 2, |