diff options
author | James McCoy <jamessan@jamessan.com> | 2016-06-22 21:02:22 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2016-06-22 21:10:07 -0400 |
commit | cde1d818d0a9ecbed0a4db95ae701b970e7f3c09 (patch) | |
tree | e0b2df227aef2aeae90caf98d96a808de1ee2c2c /test/functional/legacy/quickfix_spec.lua | |
parent | a2ecbc2cc093d6639b8d3e0262909191dfa9aba4 (diff) | |
download | rneovim-cde1d818d0a9ecbed0a4db95ae701b970e7f3c09.tar.gz rneovim-cde1d818d0a9ecbed0a4db95ae701b970e7f3c09.tar.bz2 rneovim-cde1d818d0a9ecbed0a4db95ae701b970e7f3c09.zip |
vim-patch:7.4.1592
Problem: Quickfix code using memory after being freed. (Dominique Pelle)
Solution: Detect that the window was closed. (Hirohito Higashi)
https://github.com/vim/vim/commit/0899d698030ec076eb26352cda1ea334ab0819d9
Diffstat (limited to 'test/functional/legacy/quickfix_spec.lua')
-rw-r--r-- | test/functional/legacy/quickfix_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/legacy/quickfix_spec.lua b/test/functional/legacy/quickfix_spec.lua index ca98765336..df8f2625db 100644 --- a/test/functional/legacy/quickfix_spec.lua +++ b/test/functional/legacy/quickfix_spec.lua @@ -258,6 +258,25 @@ describe('helpgrep', function() \ l[3].lnum == 750 && l[3].col == 25 && l[3].text ==# 'Line 750') 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 ]]) end) @@ -315,4 +334,9 @@ describe('helpgrep', function() execute('copen') eq(':setqflist()', eval('g:foo')) end) + + it('errors when an autocommand closes the location list\'s window', function() + call('Test_locationlist_curwin_was_closed') + expected_empty() + end) end) |