Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kat0h committed Dec 5, 2020
2 parents 0df6c81 + d0ba8ec commit b527f59
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions autoload/colorschemes_settings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ function! s:switch_background(
endfunction

function! g:colorschemes_settings#switch_background()
let l:nowcolor = s:get_colors_name()
let l:backgrounds = s:get_vim_backgrounds()

" check inversed background
execute "set background=" .. l:backgrounds[1]
let l:able_to_inverse = s:get_colors_name() ==# l:nowcolor
" restore background and colorscheme
execute "set background=" .. l:backgrounds[0]
execute "colorscheme " .. l:nowcolor

if ! l:able_to_inverse
echomsg "Cannot inverse background on " .. l:nowcolor
return
endif
call s:switch_background(g:colorschemes_settings#rc_file_path)
endfunction

Expand Down

0 comments on commit b527f59

Please sign in to comment.