diff options
author | cangscop <cangscop@gmail.com> | 2019-07-28 00:19:41 +0200 |
---|---|---|
committer | cangscop <cangscop@gmail.com> | 2019-07-28 00:19:41 +0200 |
commit | dedcd3ad1e87f5130dd6d32ec6cfe642553bcb39 (patch) | |
tree | 3dd46ae309f4cfea061d72f3d1c55e6fc96eb9a3 | |
parent | 0364e47ccb8705d48146f00d68506d5f9cefb0aa (diff) | |
download | rneovim-dedcd3ad1e87f5130dd6d32ec6cfe642553bcb39.tar.gz rneovim-dedcd3ad1e87f5130dd6d32ec6cfe642553bcb39.tar.bz2 rneovim-dedcd3ad1e87f5130dd6d32ec6cfe642553bcb39.zip |
vim-patch:8.1.0053 use typval_T in the caller of call_vim_function
Problem: unreliable types for complete function arguments
Solution: fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
-rw-r--r-- | src/nvim/testdir/test_ins_complete.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 071e82579e..7f52481ba8 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -250,6 +250,31 @@ func Test_omni_dash() set omnifunc= endfunc +func Test_completefunc_args() + let s:args = [] + func! CompleteFunc(findstart, base) + let s:args += [[a:findstart, empty(a:base)]] + endfunc + new + + set completefunc=CompleteFunc + call feedkeys("i\<C-X>\<C-U>\<Esc>", 'x') + call assert_equal([1, 1], s:args[0]) + call assert_equal(0, s:args[1][0]) + set completefunc= + + let s:args = [] + set omnifunc=CompleteFunc + call feedkeys("i\<C-X>\<C-O>\<Esc>", 'x') + call assert_equal([1, 1], s:args[0]) + call assert_equal(0, s:args[1][0]) + set omnifunc= + + bwipe! + unlet s:args + delfunc CompleteFunc +endfunc + " Check that when using feedkeys() typeahead does not interrupt searching for " completions. func Test_compl_feedkeys() |