mirror of
https://github.com/neovim/neovim.git
synced 2025-12-07 23:22:39 +00:00
vim-patch:7.4.1592
Problem: Quickfix code using memory after being freed. (Dominique Pelle)
Solution: Detect that the window was closed. (Hirohito Higashi)
0899d69803
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user