aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-02 10:58:10 +0800
committerGitHub <noreply@github.com>2024-08-02 02:58:10 +0000
commit48e4589eaded3213956aa9ddbcc0aa6971a974e5 (patch)
treec07e1ff8cbd38f946815efa8516dd8a40188fdac /test
parent3bc864e7739d9fa8b086f5606a666abb4a34054d (diff)
downloadrneovim-48e4589eaded3213956aa9ddbcc0aa6971a974e5.tar.gz
rneovim-48e4589eaded3213956aa9ddbcc0aa6971a974e5.tar.bz2
rneovim-48e4589eaded3213956aa9ddbcc0aa6971a974e5.zip
vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" (#29950)
Problem: Vim9: using a script-local function requires using "s:" when setting 'completefunc'. Solution: Do not require "s:" in Vim9 script. (closes vim/vim#9796) https://github.com/vim/vim/commit/1fca5f3e86f08e696058fc7e86dfe41b415a78e6 vim-patch:8.2.4417: using NULL pointer Problem: Using NULL pointer. Solution: Set offset after checking for NULL pointer. https://github.com/vim/vim/commit/e89bfd212b21c227f026e467f882c62cdd6e642d Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_ins_complete.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim
index 882e707f63..b90c0013d9 100644
--- a/test/old/testdir/test_ins_complete.vim
+++ b/test/old/testdir/test_ins_complete.vim
@@ -1691,6 +1691,23 @@ func Test_completefunc_callback()
bw!
delfunc s:CompleteFunc3
+ " In Vim9 script s: can be omitted
+ let lines =<< trim END
+ vim9script
+ var CompleteFunc4Args = []
+ def CompleteFunc4(findstart: bool, base: string): any
+ add(CompleteFunc4Args, [findstart, base])
+ return findstart ? 0 : []
+ enddef
+ set completefunc=CompleteFunc4
+ new
+ setline(1, 'script1')
+ feedkeys("A\<C-X>\<C-U>\<Esc>", 'x')
+ assert_equal([[1, ''], [0, 'script1']], CompleteFunc4Args)
+ bw!
+ END
+ call CheckScriptSuccess(lines)
+
" invalid return value
let &completefunc = {a -> 'abc'}
call feedkeys("A\<C-X>\<C-U>\<Esc>", 'x')