1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 23:49:19 +08:00

Merge pull request #186 from SpaceVim/getcompletion

Fix #183
This commit is contained in:
Wang Shidong 2017-01-31 21:19:26 +08:00 committed by GitHub
commit 85c24a2793

View File

@ -1,11 +1,25 @@
function! SpaceVim#options#list() abort
let list = []
if has('patch-7.4.2010')
if has('patch-7.4.2010') && 0
for var in getcompletion('g:spacevim_','var')
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
endfor
else
call add(list, 'your vim is too old, getcompletion() need patch7-4-2010')
redraw
for var in filter(map(s:execute('let g:'), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
endfor
endif
return list
endfunction
function! s:execute(cmd) abort
if exists('*execute')
return split(execute(a:cmd), "\n")
endif
redir => output
execute a:cmd
redir END
return split(output, "\n")
endfunction