我建立一個自定義的unite.vim源的選擇之一應該能夠調用可以接受dictonary傳遞一個字典的功能viml
function! s:source.gather_candidates(args, context) abort "{{{
let l:nodeInfo = a:context.file
return [
\{
\ 'word': 'delete the current node',
\ 'kind': 'command',
\ 'source': s:source.name,
\ 'action__command': 'call DeleteNode(' . l:nodeInfo .')',
\ }]
endfunction "}}}
然後只是測試它的功能出,回聲字典
function! DeleteNode(node) abort "{{{
let l:currentNode = a:node
echo l:currentNode
endfunction "}}}
但是,當我試圖加載我的源代碼,我得到
Vim(return):E731: using Dictionary as a String
我怎樣才能通過字典(大約24個鍵)的功能?
@at誰投了「題外話理由」:這個問題是完全的話題,因爲它是一個VimL編程問題。 –
你確定你使用':echo'而不是':echom'嗎? – romainl
當出現這樣的錯誤時,Vim通常會打印出上下文。 Vim提到哪一行? –