diff options
| author | Bram Moolenaar <Bram@vim.org> | 2022-02-23 12:06:00 +0000 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2022-02-23 12:06:00 +0000 |
| commit | 4791fcd82565adcc60b86830e0bb6cd5b6eea0a6 (patch) | |
| tree | 8d9a1ba4631efb742ea1617c99b61e0c3f85322c /src/testdir/test_quickfix.vim | |
| parent | 2dada73a4ebffe2582af472ce362abd3116b58c9 (diff) | |
| download | vim-git-8.2.4453.tar.gz | |
patch 8.2.4453: :helpgrep may free an option that was not allocatedv8.2.4453
Problem: :helpgrep may free an option that was not allocated. (Yegappan
Lakshmanan)
Solution: Check if the value was allocated.
Diffstat (limited to 'src/testdir/test_quickfix.vim')
| -rw-r--r-- | src/testdir/test_quickfix.vim | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 7d2373b82..ccfa340f6 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -745,6 +745,33 @@ def Test_helpgrep_vim9_restore_cpo() helpclose enddef +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 + def Test_vim9_cexpr() var text = 'somefile:95:error' cexpr text |
