From 8376d2c4b11025e0420d2faa037fad6b8b77aa81 Mon Sep 17 00:00:00 2001 From: roxma Date: Sat, 6 Apr 2019 23:49:22 +0200 Subject: vim-patch:8.1.1123: avoid filtering autocomplete Author: roxma 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 --- src/nvim/testdir/test_popup.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/nvim/testdir') 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 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 =s:complTest1() + call feedkeys("i\z\\\.", 'tx') + call assert_equal('z', getline(1)) + bwipe! + + " with equal=1 + new + set completeopt=menuone,noinsert,menu + inoremap =s:complTest2() + call feedkeys("i\z\\\.", 'tx') + call assert_equal('foobar', getline(1)) + bwipe! + + let &completeopt = completeopt + iunmap +endfunc + func Test_compl_vim_cmds_after_register_expr() func! s:test_func() return 'autocmd ' -- cgit