fix an error when calling cmp#unregister_source from Vimscript (#413)
This commit is contained in:
@@ -35,12 +35,9 @@ endfunction
|
|||||||
" cmp#unregister_source
|
" cmp#unregister_source
|
||||||
"
|
"
|
||||||
function! cmp#unregister_source(id) abort
|
function! cmp#unregister_source(id) abort
|
||||||
for [l:i, l:source] in s:sources
|
if has_key(s:sources, a:id)
|
||||||
if l:source.id == a:id
|
unlet s:sources[a:id]
|
||||||
call remove(s:sources, index(s:sources, l:source))
|
endif
|
||||||
break
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
call luaeval('require("cmp").unregister_source(_A)', a:id)
|
call luaeval('require("cmp").unregister_source(_A)', a:id)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -77,4 +74,3 @@ endfunction
|
|||||||
function! s:callback(id) abort
|
function! s:callback(id) abort
|
||||||
return { ... -> luaeval('require("cmp.vim_source").on_callback(_A[1], _A[2])', [a:id, a:000]) }
|
return { ... -> luaeval('require("cmp.vim_source").on_callback(_A[1], _A[2])', [a:id, a:000]) }
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user