comparison runtime/doc/options.txt @ 34069:170e917524f7 v9.1.0004

patch 9.1.0004: reloading colorscheme when not changing 'background' Commit: https://github.com/vim/vim/commit/83ad2726ff56db70cb2da78e1e4ea0e09941c73b Author: Gregory Anders <greg@gpanders.com> Date: Wed Jan 3 19:48:51 2024 +0100 patch 9.1.0004: reloading colorscheme when not changing 'background' 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>
author Christian Brabandt <cb@256bit.org>
date Wed, 03 Jan 2024 20:00:06 +0100
parents 4635e43f2c6f
children e7d64a3fffe4
comparison
equal deleted inserted replaced
34068:f7816a6f68ed 34069:170e917524f7
1 *options.txt* For Vim version 9.1. Last change: 2023 Dec 20 1 *options.txt* For Vim version 9.1. Last change: 2024 Jan 03
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
995 This will not always be correct. 995 This will not always be correct.
996 Setting this option does not change the background color, it tells Vim 996 Setting this option does not change the background color, it tells Vim
997 what the background color looks like. For changing the background 997 what the background color looks like. For changing the background
998 color, see |:hi-normal|. 998 color, see |:hi-normal|.
999 999
1000 When 'background' is set Vim will adjust the default color groups for 1000 When 'background' is changed Vim will adjust the default color groups
1001 the new value. But the colors used for syntax highlighting will not 1001 for the new value. But the colors used for syntax highlighting will
1002 change. *g:colors_name* 1002 not change. *g:colors_name*
1003 When a color scheme is loaded (the "g:colors_name" variable is set) 1003 When a color scheme is loaded (the "g:colors_name" variable is set)
1004 setting 'background' will cause the color scheme to be reloaded. If 1004 changing 'background' will cause the color scheme to be reloaded. If
1005 the color scheme adjusts to the value of 'background' this will work. 1005 the color scheme adjusts to the value of 'background' this will work.
1006 However, if the color scheme sets 'background' itself the effect may 1006 However, if the color scheme sets 'background' itself the effect may
1007 be undone. First delete the "g:colors_name" variable when needed. 1007 be undone. First delete the "g:colors_name" variable when needed.
1008 1008
1009 When setting 'background' to the default value with: > 1009 When setting 'background' to the default value with: >