now sets background before the colorscheme

This commit is contained in:
Reed Esau
2014-01-05 13:20:47 -07:00
parent 62eb63a7c3
commit 80f540e375

View File

@@ -151,7 +151,16 @@ function! thematic#init(mode) abort
let l:th = get(g:thematic#themes, l:theme_name, {})
endif
" ------ Set colorscheme and background ------
" ------ Set background and colorscheme ------
" Use the original background, if not explicit and no default.
" Note that we're setting background BEFORE the colorscheme,
" because many colorschemes will deliberately override it.
" And some, like solarized, will dynamically adjust to it.
let l:bg = thematic#getThemeValue(l:th, 'background', '')
if (l:bg == 'light' || l:bg == 'dark') && &background != l:bg
execute 'set background=' . l:bg
endif
" assume the colorscheme matches the theme name if not explicit
let l:cs = get(l:th, 'colorscheme', l:theme_name)
@@ -165,12 +174,6 @@ function! thematic#init(mode) abort
endif
endtry
" use the original background, if not explicit and no default
let l:bg = thematic#getThemeValue(l:th, 'background', '')
if (l:bg == 'light' || l:bg == 'dark') && &background != l:bg
execute 'set background=' . l:bg
endif
" ------ Fix/mute colors ------
let l:gui_running = has('gui_running')