# HG changeset patch # User Christian Brabandt # Date 1468094407 -7200 # Node ID 5fb484647e12293919079c8a9945b03fdd6ed9be # Parent d5ccc59b203f357bd95705984941664bd37491ba commit https://github.com/vim/vim/commit/32b808a4bdf35b0dea63c735702a591e5869fecd Author: Bram Moolenaar Date: Sat Jul 9 21:57:20 2016 +0200 patch 7.4.2014 Problem: Using "noinsert" in 'completeopt' does not insert match. Solution: Set compl_enter_selects. (Shougo, closes https://github.com/vim/vim/issues/875) diff --git a/src/edit.c b/src/edit.c --- a/src/edit.c +++ b/src/edit.c @@ -2831,6 +2831,7 @@ set_completion(colnr_T startcol, list_T } else ins_complete(Ctrl_N, FALSE); + compl_enter_selects = compl_no_insert; /* Lazily show the popup menu, unless we got interrupted. */ if (!compl_interrupted) diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -49,8 +49,20 @@ func Test_noinsert_complete() call feedkeys("i\soun\\\.", 'tx') call assert_equal('soundfold', getline(1)) call assert_equal('soundfold', getline(2)) + bwipe! + new + inoremap =Test() + call feedkeys("i\\\", 'tx') + call assert_equal('source', getline(1)) bwipe! + set completeopt-=noinsert iunmap endfunc + + +function! Test() abort + call complete(1, ['source', 'soundfold']) + return '' +endfunction diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2014, +/**/ 2013, /**/ 2012,