forked from aniani/vim
patch 7.4.2013
Problem: Using "noinsert" in 'completeopt' breaks redo. Solution: Set compl_curr_match. (Shougo, closes #874)
This commit is contained in:
@@ -4680,6 +4680,7 @@ ins_compl_insert(void)
|
|||||||
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO]));
|
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO]));
|
||||||
}
|
}
|
||||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict);
|
set_vim_var_dict(VV_COMPLETED_ITEM, dict);
|
||||||
|
compl_curr_match = compl_shown_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Test for completion menu
|
" Test for completion menu
|
||||||
|
|
||||||
inoremap <F5> <C-R>=ListMonths()<CR>
|
|
||||||
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||||
let g:setting = ''
|
let g:setting = ''
|
||||||
|
|
||||||
@@ -14,6 +13,8 @@ endfunc
|
|||||||
|
|
||||||
func! Test_popup_completion_insertmode()
|
func! Test_popup_completion_insertmode()
|
||||||
new
|
new
|
||||||
|
inoremap <F5> <C-R>=ListMonths()<CR>
|
||||||
|
|
||||||
call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
|
call feedkeys("a\<f5>\<down>\<enter>\<esc>", 'tx')
|
||||||
call assert_equal('February', getline(1))
|
call assert_equal('February', getline(1))
|
||||||
%d
|
%d
|
||||||
@@ -31,5 +32,25 @@ func! Test_popup_completion_insertmode()
|
|||||||
%d
|
%d
|
||||||
call feedkeys("a\<f5>\<c-p>\<c-p>\<enter>\<esc>", 'tx')
|
call feedkeys("a\<f5>\<c-p>\<c-p>\<enter>\<esc>", 'tx')
|
||||||
call assert_equal('December', getline(1))
|
call assert_equal('December', getline(1))
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
|
iunmap <F5>
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
function! ComplTest() abort
|
||||||
|
call complete(1, ['source', 'soundfold'])
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
func Test_noinsert_complete()
|
||||||
|
new
|
||||||
|
set completeopt+=noinsert
|
||||||
|
inoremap <F5> <C-R>=ComplTest()<CR>
|
||||||
|
call feedkeys("i\<F5>soun\<CR>\<CR>\<ESC>.", 'tx')
|
||||||
|
call assert_equal('soundfold', getline(1))
|
||||||
|
call assert_equal('soundfold', getline(2))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
set completeopt-=noinsert
|
||||||
|
iunmap <F5>
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
2013,
|
||||||
/**/
|
/**/
|
||||||
2012,
|
2012,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user