1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

check for invalid colorscheme

This commit is contained in:
jdhao 2020-10-19 01:29:06 +08:00
parent 61ff354de0
commit 43902a31d8

9
ui.vim
View File

@ -113,6 +113,13 @@ function! s:my_theme_dict.neodark() dict abort
colorscheme neodark
endfunction
execute printf('call s:my_theme_dict.%s()', s:theme)
let s:colorscheme_func = printf('s:my_theme_dict.%s()', s:theme)
if has_key(s:my_theme_dict, s:theme)
execute 'call ' . s:colorscheme_func
else
echohl WarningMsg
echomsg 'Invalid colorscheme function: ' s:colorscheme_func ', using default instead.'
echohl None
endif
"}}
"}