aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-06 09:41:52 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-06 09:41:52 +1300
commita74f73043be2eb355e96311f5a4d01a915e024fe (patch)
tree53d8c476935fd587a245bb627158894610fd5c59 /vim/autoload
parentComplete ToggleOptionFlag commands with opt names (diff)
downloaddotfiles-a74f73043be2eb355e96311f5a4d01a915e024fe.tar.gz
dotfiles-a74f73043be2eb355e96311f5a4d01a915e024fe.zip
Make background detection return not set value
This approach allows more flexibility from the caller's side.
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/detect_background.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/vim/autoload/detect_background.vim b/vim/autoload/detect_background.vim
index e4fee199..9758f8d3 100644
--- a/vim/autoload/detect_background.vim
+++ b/vim/autoload/detect_background.vim
@@ -3,6 +3,9 @@
" light backgrounds; we'll default to choosing a dark background unless we
" find some reason *not* to.
"
+" Return the string to which we think the option should be set, to allow the
+" caller to use it as they see fit.
+"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
@@ -27,9 +30,9 @@ function! detect_background#DetectBackground() abort
if l:bg ==# 'default'
\ || l:bg ==# '7'
\ || l:bg ==# '15'
- set background=light
+ return 'light'
else
- set background=dark
+ return 'dark'
endif
endfunction