Hi all,
When running the 'helpgrep' command if an autocmd modifies the 'cpo' option,
then Vim crashes. This issue was reported back in 2008:
https://groups.google.com/g/vim_dev/c/_xIqgmPwZYM/m/fAZNMm8OOzsJ
This was supposed to be fixed by 7.2b-004:
https://groups.google.com/g/vim_dev/c/yH1xPvbUeFw/m/ljDl2ZRNdTsJ
But I am still able to reproduce this crash using the following test function:
-------------------------------------------------------------
func Test_helpgrep_restore_cpo()
let save_cpo = &cpo
augroup QF_Test
au!
autocmd BufNew * set cpo=acd
augroup END
helpgrep quickfix
call assert_equal('acd', &cpo)
%bw!
set cpo&vim
augroup QF_Test
au!
autocmd BufNew * set cpo=
augroup END
helpgrep buffer
call assert_equal('', &cpo)
augroup QF_Test
au!
augroup END
%bw!
let &cpo = save_cpo
endfunc
-------------------------------------------------------------
Regards,
Yegappan