1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +08:00

fix(core): check requirements when change autocomplete_method

This commit is contained in:
wsdjeg 2023-04-15 22:43:17 +08:00
parent efa65d6537
commit f7ccafb114

View File

@ -63,9 +63,9 @@ endfunction
function! s:global_dir() abort
if empty($SPACEVIMDIR)
if !empty($XDG_CONFIG_HOME)
return s:FILE.unify_path($XDG_CONFIG_HOME.'/SpaceVim.d/')
return s:FILE.unify_path($XDG_CONFIG_HOME.'/SpaceVim.d/')
else
return s:FILE.unify_path($HOME.'/.SpaceVim.d/')
return s:FILE.unify_path($HOME.'/.SpaceVim.d/')
endif
else
return s:FILE.unify_path($SPACEVIMDIR)
@ -161,6 +161,17 @@ function! s:apply(config, type) abort
continue
endif
" keep backward compatibility
elseif name ==# 'autocomplete_method'
if value ==# 'deoplete' && !has('python3')
if (has('python3')
\ && (SpaceVim#util#haspy3lib('neovim')
\ || SpaceVim#util#haspy3lib('pynvim'))) &&
\ (has('nvim') || (has('patch-8.0.0027')))
else
call SpaceVim#logger#warn('deoplete requires +python3!')
continue
endif
endif
elseif name ==# 'statusline_right_sections'
let name = 'statusline_right'
elseif name ==# 'statusline_right_sections'