aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-03 06:15:31 +0800
committerGitHub <noreply@github.com>2024-04-03 06:15:31 +0800
commit30b94ae4942b4e82030bc079368dd7fcb5481456 (patch)
tree30681ab75de2001f04f20531b0160f41de5c61ff /test/old/testdir
parentd9235efa76229708586d3c9db3dcbac46127ca0a (diff)
parentaeabd8e2455b979c70277ea83eb9f3375a37bc6f (diff)
downloadrneovim-30b94ae4942b4e82030bc079368dd7fcb5481456.tar.gz
rneovim-30b94ae4942b4e82030bc079368dd7fcb5481456.tar.bz2
rneovim-30b94ae4942b4e82030bc079368dd7fcb5481456.zip
Merge pull request #28153 from zeertzjq/vim-9.0.0581
vim-patch:9.{0.0581,1.0254}
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_ins_complete.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim
index ac04187a7b..3f67a06999 100644
--- a/test/old/testdir/test_ins_complete.vim
+++ b/test/old/testdir/test_ins_complete.vim
@@ -2490,4 +2490,26 @@ func Test_complete_changed_complete_info()
call StopVimInTerminal(buf)
endfunc
+func Test_completefunc_first_call_complete_add()
+ new
+
+ func Complete(findstart, base) abort
+ if a:findstart
+ let col = col('.')
+ call complete_add('#')
+ return col - 1
+ else
+ return []
+ endif
+ endfunc
+
+ set completeopt=longest completefunc=Complete
+ " This used to cause heap-buffer-overflow
+ call assert_fails('call feedkeys("ifoo#\<C-X>\<C-U>", "xt")', 'E840:')
+
+ delfunc Complete
+ set completeopt& completefunc&
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable