]> granicus.if.org Git - vim/commitdiff
patch 7.4.2014 v7.4.2014
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2016 19:57:20 +0000 (21:57 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2016 19:57:20 +0000 (21:57 +0200)
Problem:    Using "noinsert" in 'completeopt' does not insert match.
Solution:   Set compl_enter_selects. (Shougo, closes #875)

src/edit.c
src/testdir/test_popup.vim
src/version.c

index 47c24f9d2f173ac77f6b072f8425e65c8deff846..4bce8a30c7200165157e7094bf8d0ceb45b40410 100644 (file)
@@ -2831,6 +2831,7 @@ set_completion(colnr_T startcol, list_T *list)
     }
     else
        ins_complete(Ctrl_N, FALSE);
+    compl_enter_selects = compl_no_insert;
 
     /* Lazily show the popup menu, unless we got interrupted. */
     if (!compl_interrupted)
index cefaee26af46b2b4fb7fa7b1e9dc416a64c22be9..ea489f9c935d378cec3a3074105f7ee29b6f0663 100644 (file)
@@ -49,8 +49,20 @@ func Test_noinsert_complete()
   call feedkeys("i\<F5>soun\<CR>\<CR>\<ESC>.", 'tx')
   call assert_equal('soundfold', getline(1))
   call assert_equal('soundfold', getline(2))
+  bwipe!
 
+  new
+  inoremap <F5>  <C-R>=Test()<CR>
+  call feedkeys("i\<F5>\<CR>\<ESC>", 'tx')
+  call assert_equal('source', getline(1))
   bwipe!
+
   set completeopt-=noinsert
   iunmap <F5>
 endfunc
+
+
+function! Test() abort
+  call complete(1, ['source', 'soundfold'])
+  return ''
+endfunction
index f1da7b31f4dcd978f29708c8371be3313595cbaf..86c8c066e35759a748c24aaa18a9b2c5840c8ecc 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2014,
 /**/
     2013,
 /**/