mirror of
https://github.com/neovim/neovim.git
synced 2025-12-07 23:22:39 +00:00
terminal: handle &confirm and :confirm on unloading (#8726)
Show a proper confirmation dialog when trying to unload a terminal buffer while the confirm option is set or when :confirm is used. Fixes https://github.com/neovim/neovim/issues/4651
This commit is contained in:
@@ -201,6 +201,28 @@ describe('terminal buffer', function()
|
||||
feed([[<C-\><C-n>]])
|
||||
feed_command('bdelete!')
|
||||
end)
|
||||
|
||||
describe('handles confirmations', function()
|
||||
it('with :confirm', function()
|
||||
feed_command('terminal')
|
||||
feed('<c-\\><c-n>')
|
||||
feed_command('confirm bdelete')
|
||||
screen:expect('Close "term://', nil, true, nil, true)
|
||||
end)
|
||||
|
||||
it('with &confirm', function()
|
||||
feed_command('terminal')
|
||||
feed('<c-\\><c-n>')
|
||||
feed_command('bdelete')
|
||||
screen:expect('E89', nil, true, nil, true)
|
||||
feed('<cr>')
|
||||
eq('terminal', eval('&buftype'))
|
||||
feed_command('set confirm | bdelete')
|
||||
screen:expect('Close "term://', nil, true, nil, true)
|
||||
feed('y')
|
||||
neq('terminal', eval('&buftype'))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('No heap-buffer-overflow when using', function()
|
||||
|
||||
Reference in New Issue
Block a user