summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_ins_complete.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
commitbee19c22d569e54513a9c591441c7f411811dc81 (patch)
treeb990d2df9fddb8194bfe49e9205005a0d952bc1f /src/testdir/test_ins_complete.vim
parentAdding upstream version 2:9.1.0199. (diff)
downloadvim-97c93a6e6cafbb0d7a9eb94a18a7cadeb8e23a9f.tar.xz
vim-97c93a6e6cafbb0d7a9eb94a18a7cadeb8e23a9f.zip
Adding upstream version 2:9.1.0374.upstream/2%9.1.0374
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_ins_complete.vim')
-rw-r--r--src/testdir/test_ins_complete.vim24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index 52306e8..eb89a15 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -1130,7 +1130,7 @@ func Test_complete_wholeline_unlistedbuf()
edit Xfile1
enew
set complete=U
- " completing from a unloaded buffer should fail
+ " completing from an unloaded buffer should fail
exe "normal! ia\<C-X>\<C-L>\<C-P>"
call assert_equal('a', getline(1))
%d
@@ -2429,4 +2429,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