Skip to content

Commit 179eb56

Browse files
committed
patch 8.2.2230: Vim9: insert completion runs into error
Problem: Vim9: insert completion runs into error. Solution: Insert colon before range. (closes #7556)
1 parent 39cb2da commit 179eb56

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/insexpand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ ins_compl_show_pum(void)
10201020

10211021
#if defined(FEAT_EVAL)
10221022
// Dirty hard-coded hack: remove any matchparen highlighting.
1023-
do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|3match none|endif");
1023+
do_cmdline_cmd((char_u *)"if exists('g:loaded_matchparen')|:3match none|endif");
10241024
#endif
10251025

10261026
// Update the screen later, before drawing the popup menu over it.

src/testdir/test_vim9_cmd.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,4 +816,23 @@ def Test_gdefault_not_used()
816816
bwipe!
817817
enddef
818818

819+
def g:SomeComplFunc(findstart: number, base: string): any
820+
if findstart
821+
return 0
822+
else
823+
return ['aaa', 'bbb']
824+
endif
825+
enddef
826+
827+
def Test_insert_complete()
828+
# this was running into an error with the matchparen hack
829+
new
830+
set completefunc=SomeComplFunc
831+
feedkeys("i\<c-x>\<c-u>\<Esc>", 'ntx')
832+
assert_equal('aaa', getline(1))
833+
834+
set completefunc=
835+
bwipe!
836+
enddef
837+
819838
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2230,
753755
/**/
754756
2229,
755757
/**/

0 commit comments

Comments
 (0)