0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.2014

Problem:    Using "noinsert" in 'completeopt' does not insert match.
Solution:   Set compl_enter_selects. (Shougo, closes #875)
This commit is contained in:
Bram Moolenaar 2016-07-09 21:57:20 +02:00
parent 67081e5061
commit 32b808a4bd
3 changed files with 16 additions and 1 deletions

View File

@ -2831,6 +2831,7 @@ set_completion(colnr_T startcol, list_T *list)
} }
else else
ins_complete(Ctrl_N, FALSE); ins_complete(Ctrl_N, FALSE);
compl_enter_selects = compl_no_insert;
/* Lazily show the popup menu, unless we got interrupted. */ /* Lazily show the popup menu, unless we got interrupted. */
if (!compl_interrupted) if (!compl_interrupted)

View File

@ -49,8 +49,20 @@ func Test_noinsert_complete()
call feedkeys("i\<F5>soun\<CR>\<CR>\<ESC>.", 'tx') call feedkeys("i\<F5>soun\<CR>\<CR>\<ESC>.", 'tx')
call assert_equal('soundfold', getline(1)) call assert_equal('soundfold', getline(1))
call assert_equal('soundfold', getline(2)) call assert_equal('soundfold', getline(2))
bwipe! 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 set completeopt-=noinsert
iunmap <F5> iunmap <F5>
endfunc endfunc
function! Test() abort
call complete(1, ['source', 'soundfold'])
return ''
endfunction

View File

@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2014,
/**/ /**/
2013, 2013,
/**/ /**/