diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-12 22:05:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-12 22:05:14 +0200 |
commit | ffa9684150f5441e84d492e7184ef73587bd6c6c (patch) | |
tree | e73aa4b5e0d37ef4d113fcb07f9e1efa5c01d133 /src/testdir/test_ins_complete.vim | |
parent | 83f4cbd973731872b633d6ba0caf850fb708d70c (diff) |
patch 8.1.0053: first argument of 'completefunc' has inconsistent typev8.1.0053
Problem: The first argument given to 'completefunc' can be Number or
String, depending on the value.
Solution: Avoid guessing the type of an argument, use typval_T in the
callers of call_vim_function(). (Ozaki Kiichi, closes #2993)
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r-- | src/testdir/test_ins_complete.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 020e228820..2b4356ea38 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -117,6 +117,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(s:args[0], [1, 1]) + call assert_equal(s:args[1][0], 0) + set completefunc= + + let s:args = [] + set omnifunc=CompleteFunc + call feedkeys("i\<C-X>\<C-O>\<Esc>", 'x') + call assert_equal(s:args[0], [1, 1]) + call assert_equal(s:args[1][0], 0) + set omnifunc= + + bwipe! + unlet s:args + delfunc CompleteFunc +endfunc + function! s:CompleteDone_CompleteFuncDict( findstart, base ) if a:findstart return 0 |