fix colortheme is null when in installation process
This commit is contained in:
+22
-10
@@ -217,6 +217,22 @@
|
|||||||
let g:transparent_light_theme = v:true
|
let g:transparent_light_theme = v:true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
function! SetDarkTheme()
|
||||||
|
set background=dark
|
||||||
|
if g:dark_theme != ""
|
||||||
|
execute("colorscheme " . g:dark_theme)
|
||||||
|
endif
|
||||||
|
let g:theme_color = 'dark'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! SetLightTheme()
|
||||||
|
set background=light
|
||||||
|
if g:light_theme != ""
|
||||||
|
execute("colorscheme " . g:light_theme)
|
||||||
|
endif
|
||||||
|
let g:theme_color = 'light'
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Change bottom airline/lualine theme
|
" Change bottom airline/lualine theme
|
||||||
" Currently only support airline
|
" Currently only support airline
|
||||||
function! SetAirlineTheme(theme)
|
function! SetAirlineTheme(theme)
|
||||||
@@ -358,13 +374,11 @@
|
|||||||
" }
|
" }
|
||||||
|
|
||||||
if g:theme_color == 'dark'
|
if g:theme_color == 'dark'
|
||||||
set background=dark
|
|
||||||
execute("colorscheme " . g:dark_theme)
|
|
||||||
let g:airline_theme=g:airline_dark_theme
|
let g:airline_theme=g:airline_dark_theme
|
||||||
|
call SetDarkTheme()
|
||||||
else
|
else
|
||||||
set background=light
|
|
||||||
execute("colorscheme " . g:light_theme)
|
|
||||||
let g:airline_theme=g:airline_light_theme
|
let g:airline_theme=g:airline_light_theme
|
||||||
|
call SetLightTheme()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Since in .vimrc we cannot call plugin function as they
|
" Since in .vimrc we cannot call plugin function as they
|
||||||
@@ -388,16 +402,14 @@
|
|||||||
function! ToggleBG()
|
function! ToggleBG()
|
||||||
" Inversion
|
" Inversion
|
||||||
if g:theme_color == "dark"
|
if g:theme_color == "dark"
|
||||||
set background=light
|
|
||||||
execute("colorscheme " . g:light_theme)
|
call SetLightTheme()
|
||||||
call SetAirlineTheme(g:airline_light_theme)
|
call SetAirlineTheme(g:airline_light_theme)
|
||||||
let g:theme_color = 'light'
|
|
||||||
call CreateSignalFile('.light_theme.signal')
|
call CreateSignalFile('.light_theme.signal')
|
||||||
else
|
else
|
||||||
set background=dark
|
|
||||||
execute("colorscheme " . g:dark_theme)
|
call SetDarkTheme()
|
||||||
call SetAirlineTheme(g:airline_dark_theme)
|
call SetAirlineTheme(g:airline_dark_theme)
|
||||||
let g:theme_color = 'dark'
|
|
||||||
" for saving theme state
|
" for saving theme state
|
||||||
call DeleteSignalFile(".light_theme.signal")
|
call DeleteSignalFile(".light_theme.signal")
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user