vim-patch:9.1.1193: Unnecessary use of STRCAT() in au_event_disable() (#32829)

Problem:  Unnecessary use of STRCAT() in au_event_disable().  STRCAT()
          seeks to the end of new_ei, but here the end is already known.
Solution: Use STRCPY() and add p_ei_len to new_ei.  Also fix a typo in a
          comment.  Add a test that 'eventignore' works in :argdo
          (zeertzjq).

closes: vim/vim#16844

969e11a18b

Cherry-pick p_ei_len from patch 9.1.0256.
This commit is contained in:
zeertzjq
2025-03-11 06:54:17 +08:00
committed by GitHub
parent 1f49a59b8b
commit 7e2b75760f
3 changed files with 30 additions and 4 deletions

View File

@@ -555,9 +555,34 @@ endfunc
func Test_argdo()
next! Xa.c Xb.c Xc.c
new
let g:bufenter = 0
let g:bufleave = 0
autocmd BufEnter * let g:bufenter += 1
autocmd BufLeave * let g:bufleave += 1
let l = []
argdo call add(l, expand('%'))
call assert_equal(['Xa.c', 'Xb.c', 'Xc.c'], l)
call assert_equal(3, g:bufenter)
call assert_equal(3, g:bufleave)
let g:bufenter = 0
let g:bufleave = 0
set eventignore=BufEnter,BufLeave
let l = []
argdo call add(l, expand('%'))
call assert_equal(['Xa.c', 'Xb.c', 'Xc.c'], l)
call assert_equal(0, g:bufenter)
call assert_equal(0, g:bufleave)
call assert_equal('BufEnter,BufLeave', &eventignore)
set eventignore&
autocmd! BufEnter
autocmd! BufLeave
unlet g:bufenter
unlet g:bufleave
bwipe Xa.c Xb.c Xc.c
endfunc