]> granicus.if.org Git - vim/commitdiff
patch 8.2.2230: Vim9: insert completion runs into error v8.2.2230
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Dec 2020 17:03:22 +0000 (18:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Dec 2020 17:03:22 +0000 (18:03 +0100)
Problem:    Vim9: insert completion runs into error.
Solution:   Insert colon before range. (closes #7556)

src/insexpand.c
src/testdir/test_vim9_cmd.vim
src/version.c

index 73b2218e13bc90331c0f3d0184620fda86863c63..02f593d7c866e6a5f9146e379172fff6e7139c6b 100644 (file)
@@ -1020,7 +1020,7 @@ ins_compl_show_pum(void)
 
 #if defined(FEAT_EVAL)
     // Dirty hard-coded hack: remove any matchparen highlighting.
-    do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif");
+    do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|:3match none|endif");
 #endif
 
     // Update the screen later, before drawing the popup menu over it.
index b6644e394b83624a6f63a9c5e2655310f84d5b56..96311a5c6860fc3bfe46639e490401436195480f 100644 (file)
@@ -816,4 +816,23 @@ def Test_gdefault_not_used()
   bwipe!
 enddef
 
+def g:SomeComplFunc(findstart: number, base: string): any
+  if findstart
+    return 0
+  else
+    return ['aaa', 'bbb']
+  endif
+enddef
+
+def Test_insert_complete()
+  # this was running into an error with the matchparen hack
+  new
+  set completefunc=SomeComplFunc
+  feedkeys("i\<c-x>\<c-u>\<Esc>", 'ntx')
+  assert_equal('aaa', getline(1))
+
+  set completefunc=
+  bwipe!
+enddef
+
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
index adfaf50ebb1055b155721c181219f6b7944f80e2..51a9e42996e7dc69a3ac3b91286a9aafa582c336 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2230,
 /**/
     2229,
 /**/