From 73bdfdd382bf2addd7816571608db6911448b48a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 13 Oct 2022 09:43:06 +0800 Subject: vim-patch:8.2.4453: :helpgrep may free an option that was not allocated Problem: :helpgrep may free an option that was not allocated. (Yegappan Lakshmanan) Solution: Check if the value was allocated. https://github.com/vim/vim/commit/4791fcd82565adcc60b86830e0bb6cd5b6eea0a6 --- src/nvim/testdir/test_quickfix.vim | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 8c9e39570f..51b11b5511 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -714,6 +714,33 @@ func Test_helpgrep() call s:test_xhelpgrep('l') endfunc +func Test_helpgrep_restore_cpo_aucmd() + 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 BufReadPost * set cpo= + augroup END + + helpgrep buffer + call assert_equal('', &cpo) + + augroup QF_Test + au! + augroup END + %bw! + let &cpo = save_cpo +endfunc + func Test_errortitle() augroup QfBufWinEnter au! -- cgit