diff src/testdir/test_ins_complete.vim @ 19932:2c4d9ca33769 v8.2.0522

patch 8.2.0522: several errors are not tested for Commit: https://github.com/vim/vim/commit/ee4e0c1e9a81cb5d96e0060203a9033c2f28588e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 21:35:05 2020 +0200 patch 8.2.0522: several errors are not tested for Problem: Several errors are not tested for. Solution: Add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5892)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 21:45:31 +0200
parents 283c8bc6a8e2
children c087099e9163
line wrap: on
line diff
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -465,3 +465,23 @@ func Test_ins_compl_tag_sft()
   set tags&
   %bwipe!
 endfunc
+
+" Test for 'completefunc' deleting text
+func Test_completefunc_error()
+  new
+  func CompleteFunc(findstart, base)
+    if a:findstart == 1
+      normal dd
+      return col('.') - 1
+    endif
+    return ['a', 'b']
+  endfunc
+  set completefunc=CompleteFunc
+  call setline(1, ['', 'abcd', ''])
+  call assert_fails('exe "normal 2G$a\<C-X>\<C-U>"', 'E840:')
+  set completefunc&
+  delfunc CompleteFunc
+  close!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab