vim-patch:9.2.1012: tests: no enough testing for complete_info() "auto" (#41512)

Problem:  tests: no enough testing for complete_info() "auto"
          (after v9.2.1004)
Solution: Check triggering manual completion before 'autocompletedelay'
          expires (zeertzjq).

related: vim/vim#21143
closes:  vim/vim#21152

cc2b481c41
This commit is contained in:
zeertzjq
2026-08-27 07:54:15 +08:00
committed by GitHub
parent bb9a5087b8
commit 6eb36bcb2d

View File

@@ -6859,7 +6859,7 @@ func Test_complete_info_auto()
func! AutoOmni(findstart, base)
if a:findstart
call add(g:auto, complete_info(['auto']).auto)
return col('.') - 1
return 4
endif
return ['alpha', 'alphabet']
endfunc
@@ -6879,6 +6879,13 @@ func Test_complete_info_auto()
call feedkeys("A\<C-X>\<C-O>\<Esc>", 'tx')
call assert_equal([1, 0], g:auto)
" CTRL-X CTRL-O is typed before 'autocompletedelay' expires.
set autocompletedelay=100
let g:auto = []
call feedkeys("A\<C-X>\<C-O>\<Esc>", 'tx')
call assert_equal([0], g:auto)
set autocompletedelay&
setlocal noautocomplete
let g:auto = []
call feedkeys("A\<C-X>\<C-O>\<Esc>", 'tx')