From 2b60626ed30d96fb8f6d308f555ca4d6db1aff12 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 30 Apr 2021 11:26:06 -0700 Subject: [PATCH] Only set background color if it's changing --- vim/rc/ui.rc.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vim/rc/ui.rc.vim b/vim/rc/ui.rc.vim index a198a74..1ab2f57 100644 --- a/vim/rc/ui.rc.vim +++ b/vim/rc/ui.rc.vim @@ -72,10 +72,14 @@ function! UpdateColors() let dark_mode = substitute(system(cmd), '\n', '', 'g') " Set colorscheme and background based on mode if dark_mode ==# 'Dark' - set background=dark + if &background !=# 'dark' + set background=dark + endif call s:maybe_set_color(s:env_color_dark) else - set background=light + if &background !=# 'light' + set background=light + endif call s:maybe_set_color(s:env_color_light) endif endfunction