diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-06 13:45:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-06 13:45:55 +0200 |
commit | 73655cf0ca37a9aa8f56fc51bb853a8b1f7b43d4 (patch) | |
tree | 2068cee49d648ce30fd4496288a9de36d15a6818 /src/testdir/test_popup.vim | |
parent | 9d40128afd7fcd038ff6532722b55b1a8c189ce8 (diff) |
patch 8.1.1123: no way to avoid filtering for autocomplete functionv8.1.1123
Problem: No way to avoid filtering for autocomplete function, causing
flickering of the popup menu.
Solution: Add the "equal" field to complete items. (closes #3887)
Diffstat (limited to 'src/testdir/test_popup.vim')
-rw-r--r-- | src/testdir/test_popup.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index c69c3b00c9..a8416788ab 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -276,6 +276,38 @@ func Test_noinsert_complete() iunmap <F5> endfunc +func Test_complete_no_filter() + func! s:complTest1() abort + call complete(1, [{'word': 'foobar'}]) + return '' + endfunc + func! s:complTest2() abort + call complete(1, [{'word': 'foobar', 'equal': 1}]) + return '' + endfunc + + let completeopt = &completeopt + + " without equal=1 + new + set completeopt=menuone,noinsert,menu + inoremap <F5> <C-R>=s:complTest1()<CR> + call feedkeys("i\<F5>z\<CR>\<CR>\<ESC>.", 'tx') + call assert_equal('z', getline(1)) + bwipe! + + " with equal=1 + new + set completeopt=menuone,noinsert,menu + inoremap <F5> <C-R>=s:complTest2()<CR> + call feedkeys("i\<F5>z\<CR>\<CR>\<ESC>.", 'tx') + call assert_equal('foobar', getline(1)) + bwipe! + + let &completeopt = completeopt + iunmap <F5> +endfunc + func Test_compl_vim_cmds_after_register_expr() func! s:test_func() return 'autocmd ' |