mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 04:00:04 +08:00
Add s:execute function
thanks to tweekmonster
This commit is contained in:
parent
704a895f02
commit
342aee140c
@ -1,13 +1,25 @@
|
|||||||
function! SpaceVim#options#list() abort
|
function! SpaceVim#options#list() abort
|
||||||
let list = []
|
let list = []
|
||||||
if has('patch-7.4.2010')
|
if has('patch-7.4.2010') && 0
|
||||||
for var in getcompletion('g:spacevim_','var')
|
for var in getcompletion('g:spacevim_','var')
|
||||||
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
|
call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
|
||||||
endfor
|
endfor
|
||||||
else
|
else
|
||||||
for var in filter(map(split(execute('let g:'), "\n"), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
|
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 , '')))
|
call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
return list
|
return list
|
||||||
endfunction
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user