我建立一个自定义的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提到哪一行? –