mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 02:34:10 +00:00
vim-patch:9.1.0065: Segfault with CompleteChanged autocommand (#27261)
Problem: Segfault with CompleteChanged autocommand
(markonm )
Solution: Test match->cp_prev for being NULL before accessing it
closes: vim/vim#13929
fef6630166
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1078,7 +1078,24 @@ describe('completion', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('does not crash if text is changed by first call to complete function #17489', function()
|
||||
-- oldtest: Test_complete_changed_complete_info()
|
||||
it('no crash calling complete_info() in CompleteChanged', function()
|
||||
source([[
|
||||
set completeopt=menuone
|
||||
autocmd CompleteChanged * call complete_info(['items'])
|
||||
call feedkeys("iii\<cr>\<c-p>")
|
||||
]])
|
||||
screen:expect([[
|
||||
ii |
|
||||
ii^ |
|
||||
{2:ii }{0: }|
|
||||
{0:~ }|*4
|
||||
{3:-- Keyword completion (^N^P) The only match} |
|
||||
]])
|
||||
assert_alive()
|
||||
end)
|
||||
|
||||
it('no crash if text changed by first call to complete function #17489', function()
|
||||
source([[
|
||||
func Complete(findstart, base) abort
|
||||
if a:findstart
|
||||
@@ -1097,7 +1114,7 @@ describe('completion', function()
|
||||
assert_alive()
|
||||
end)
|
||||
|
||||
it('does not crash when using i_CTRL-X_CTRL-V to complete non-existent colorscheme', function()
|
||||
it('no crash using i_CTRL-X_CTRL-V to complete non-existent colorscheme', function()
|
||||
feed('icolorscheme NOSUCHCOLORSCHEME<C-X><C-V>')
|
||||
expect('colorscheme NOSUCHCOLORSCHEME')
|
||||
assert_alive()
|
||||
|
||||
Reference in New Issue
Block a user