diff options
| author | jdhao <jdhao@hotmail.com> | 2020-10-19 01:29:06 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2020-10-19 01:29:06 +0800 |
| commit | 43902a31d86d36cd07f2809cd0614d9d27373990 (patch) | |
| tree | 37aef4dba653ddc1292c52e3a67b43f600b3c822 | |
| parent | 61ff354de086fac2d5cfd51973721bbfd3d66cb2 (diff) | |
check for invalid colorscheme
| -rw-r--r-- | ui.vim | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 "}} "} |
