diff options
author | Marco Hinz <mh.codebro+github@gmail.com> | 2018-07-12 14:57:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-12 14:57:20 +0200 |
commit | 01570f1ff3c402af9a9a48c2cca2c5a830c08315 (patch) | |
tree | 370b8669a5fa0eac094766816db9d6bb6f3493a1 /test/functional/terminal/buffer_spec.lua | |
parent | 56065bbdc6d20feb431fe55d8165f78fb50eb8b7 (diff) | |
download | rneovim-01570f1ff3c402af9a9a48c2cca2c5a830c08315.tar.gz rneovim-01570f1ff3c402af9a9a48c2cca2c5a830c08315.tar.bz2 rneovim-01570f1ff3c402af9a9a48c2cca2c5a830c08315.zip |
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
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 4ce33fef7b..c290031fbe 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -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() |