aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-13 09:43:06 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-13 10:09:09 +0800
commit73bdfdd382bf2addd7816571608db6911448b48a (patch)
tree420b9a4c8ec18c2fb6619f4a43baf47f4c6acee3 /src/nvim/testdir
parent34c7007c32cd78b5589d72701c6669a2c378dd17 (diff)
downloadrneovim-73bdfdd382bf2addd7816571608db6911448b48a.tar.gz
rneovim-73bdfdd382bf2addd7816571608db6911448b48a.tar.bz2
rneovim-73bdfdd382bf2addd7816571608db6911448b48a.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_quickfix.vim27
1 files changed, 27 insertions, 0 deletions
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!