diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-12-16 11:18:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-16 11:18:45 -0600 |
commit | 8fb7419d7c5e2df3b792d18fa56f973088e69be2 (patch) | |
tree | 249b027da2469e716b5fea4b243ca9a59953fade /runtime/lua/vim/_meta/options.lua | |
parent | 7840760776cf8dbaa580ced87aec0222dbb693d7 (diff) | |
download | rneovim-8fb7419d7c5e2df3b792d18fa56f973088e69be2.tar.gz rneovim-8fb7419d7c5e2df3b792d18fa56f973088e69be2.tar.bz2 rneovim-8fb7419d7c5e2df3b792d18fa56f973088e69be2.zip |
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.
Diffstat (limited to 'runtime/lua/vim/_meta/options.lua')
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index f52cea9900..e63c5bb972 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -191,7 +191,7 @@ vim.go.awa = vim.go.autowriteall --- See `:hi-normal` if you want to set the background color explicitly. --- *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. @@ -203,13 +203,9 @@ vim.go.awa = vim.go.autowriteall --- : set background=dark --- :endif --- ``` ---- When this option is set, the default settings for the highlight groups +--- When this option is changed, the default settings for the highlight groups --- will change. To use other settings, place ":highlight" commands AFTER --- the setting of the 'background' option. ---- This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file ---- to select the colors for syntax highlighting. After changing this ---- option, you must load syntax.vim again to see the result. This can be ---- done with ":syntax on". --- --- @type string vim.o.background = "dark" |