summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-09 21:57:20 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-09 21:57:20 +0200
commit32b808a4bdf35b0dea63c735702a591e5869fecd (patch)
treea7e02f6424d3fd4d9dfab6318cddcc46ace41e05
parent67081e50616ae9546621072c5eaaa59bd0a4bed7 (diff)
downloadvim-git-32b808a4bdf35b0dea63c735702a591e5869fecd.tar.gz
patch 7.4.2014v7.4.2014
Problem: Using "noinsert" in 'completeopt' does not insert match. Solution: Set compl_enter_selects. (Shougo, closes #875)
-rw-r--r--src/edit.c1
-rw-r--r--src/testdir/test_popup.vim12
-rw-r--r--src/version.c2
3 files changed, 15 insertions, 0 deletions
diff --git a/src/edit.c b/src/edit.c
index 47c24f9d2..4bce8a30c 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -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)
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index cefaee26a..ea489f9c9 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index f1da7b31f..86c8c066e 100644
--- 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,