Mercurial > vim
comparison src/testdir/test_popup.vim @ 16237:56451a2677dc v8.1.1123
patch 8.1.1123: no way to avoid filtering for autocomplete function
commit https://github.com/vim/vim/commit/73655cf0ca37a9aa8f56fc51bb853a8b1f7b43d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 6 13:45:55 2019 +0200
patch 8.1.1123: no way to avoid filtering for autocomplete function
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Apr 2019 14:00:05 +0200 |
parents | 0375e54f0adc |
children | 0f65f2808470 |
comparison
equal
deleted
inserted
replaced
16236:453a46ac5660 | 16237:56451a2677dc |
---|---|
271 call feedkeys("i\<F5>\<CR>\<ESC>", 'tx') | 271 call feedkeys("i\<F5>\<CR>\<ESC>", 'tx') |
272 call assert_equal('source', getline(1)) | 272 call assert_equal('source', getline(1)) |
273 bwipe! | 273 bwipe! |
274 | 274 |
275 set completeopt-=noinsert | 275 set completeopt-=noinsert |
276 iunmap <F5> | |
277 endfunc | |
278 | |
279 func Test_complete_no_filter() | |
280 func! s:complTest1() abort | |
281 call complete(1, [{'word': 'foobar'}]) | |
282 return '' | |
283 endfunc | |
284 func! s:complTest2() abort | |
285 call complete(1, [{'word': 'foobar', 'equal': 1}]) | |
286 return '' | |
287 endfunc | |
288 | |
289 let completeopt = &completeopt | |
290 | |
291 " without equal=1 | |
292 new | |
293 set completeopt=menuone,noinsert,menu | |
294 inoremap <F5> <C-R>=s:complTest1()<CR> | |
295 call feedkeys("i\<F5>z\<CR>\<CR>\<ESC>.", 'tx') | |
296 call assert_equal('z', getline(1)) | |
297 bwipe! | |
298 | |
299 " with equal=1 | |
300 new | |
301 set completeopt=menuone,noinsert,menu | |
302 inoremap <F5> <C-R>=s:complTest2()<CR> | |
303 call feedkeys("i\<F5>z\<CR>\<CR>\<ESC>.", 'tx') | |
304 call assert_equal('foobar', getline(1)) | |
305 bwipe! | |
306 | |
307 let &completeopt = completeopt | |
276 iunmap <F5> | 308 iunmap <F5> |
277 endfunc | 309 endfunc |
278 | 310 |
279 func Test_compl_vim_cmds_after_register_expr() | 311 func Test_compl_vim_cmds_after_register_expr() |
280 func! s:test_func() | 312 func! s:test_func() |