diff options
| author | roxma <roxma@qq.com> | 2019-04-06 23:49:22 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-07 00:56:26 +0200 |
| commit | 8376d2c4b11025e0420d2faa037fad6b8b77aa81 (patch) | |
| tree | 40f77bbb2de6ddafc61bb9c63fb782494adc9a83 /src/nvim/testdir | |
| parent | 3cd9422c4c43fc7f4e6397a2b07a9ab05d4026cf (diff) | |
| download | rneovim-8376d2c4b11025e0420d2faa037fad6b8b77aa81.tar.gz rneovim-8376d2c4b11025e0420d2faa037fad6b8b77aa81.tar.bz2 rneovim-8376d2c4b11025e0420d2faa037fad6b8b77aa81.zip | |
vim-patch:8.1.1123: avoid filtering autocomplete
Author: roxma <roxma@qq.com>
Problem: No way to avoid filtering for autocomplete function, causing
flickering of the popup menu.
Solution: Add the "equal" field to complete items. (closes vim/vim#3887)
https://github.com/vim/vim/commit/73655cf0ca37a9aa8f56fc51bb853a8b1f7b43d4
closes #9566
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_popup.vim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 41c27a68a6..96f4bfc71b 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -275,6 +275,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 ' |