Mercurial > vim
diff src/testdir/test_quickfix.vim @ 8605:536b9b88d1ca v7.4.1592
commit https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 19 13:35:03 2016 +0100
patch 7.4.1592
Problem: Quickfix code using memory after being freed. (Dominique Pelle)
Solution: Detect that the window was closed. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Mar 2016 13:45:04 +0100 |
parents | bfa74b84c41c |
children | ec78ecf15de7 |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -495,3 +495,22 @@ function Test_locationlist() augroup! testgroup endfunction + +function Test_locationlist_curwin_was_closed() + augroup testgroup + au! + autocmd BufReadCmd t call R(expand("<amatch>")) + augroup END + + function R(n) + quit + endfunc + + new + let q = [] + call add(q, {'filename': 't' }) + call setloclist(0, q) + call assert_fails('lrewind', 'E924:') + + augroup! testgroup +endfunction