9
我想寫一個包裝到一個插件的功能,但它使用可變參數(...
)。我如何將我的函數收到的相同參數傳遞給插件的函數?如何將varargs傳遞給vimscript中的另一個函數?
例子:
function! PluginInterface(...)
for i in a:000
echo i
endfor
endfunction
function! MyInterface(...)
echo a:1 . ' is great'
call PluginInterface(a:000)
endfunction
echo '>> Their call'
call PluginInterface('hello', 'world')
echo '>> My call'
call MyInterface('hello', 'world')