aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/system_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-30 13:11:35 +0800
committerGitHub <noreply@github.com>2022-04-30 13:11:35 +0800
commit2ba539f449a95f38463a61b189e203a5fe306fc0 (patch)
tree03469caff9c6c1d0cc8da4338f51cc28236a6d9a /test/functional/vimscript/system_spec.lua
parent7df25a1372fde01d9498ddef349a0b7851045cc7 (diff)
downloadrneovim-2ba539f449a95f38463a61b189e203a5fe306fc0.tar.gz
rneovim-2ba539f449a95f38463a61b189e203a5fe306fc0.tar.bz2
rneovim-2ba539f449a95f38463a61b189e203a5fe306fc0.zip
fix(input): only disable mapped CTRL-C interrupts when getting input (#18310)
Diffstat (limited to 'test/functional/vimscript/system_spec.lua')
-rw-r--r--test/functional/vimscript/system_spec.lua45
1 files changed, 44 insertions, 1 deletions
diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua
index bedf7e5498..9cc6424d31 100644
--- a/test/functional/vimscript/system_spec.lua
+++ b/test/functional/vimscript/system_spec.lua
@@ -268,7 +268,7 @@ describe('system()', function()
:call system("for /L %I in (1,0,2) do @echo y") |]]
or [[
:call system("yes") |]]))
- feed('<c-c>')
+ feed('foo<c-c>')
screen:expect([[
^ |
~ |
@@ -286,6 +286,49 @@ describe('system()', function()
Type :qa and press <Enter> to exit Nvim |
]])
end)
+
+ it('`yes` interrupted with mapped CTRL-C', function()
+ command('nnoremap <C-C> i')
+ feed(':call system("' .. (iswin()
+ and 'for /L %I in (1,0,2) do @echo y'
+ or 'yes') .. '")<cr>')
+ screen:expect([[
+ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+]] .. (iswin()
+ and [[
+ :call system("for /L %I in (1,0,2) do @echo y") |]]
+ or [[
+ :call system("yes") |]]))
+ feed('foo<c-c>')
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ -- INSERT -- |
+ ]])
+ end)
end)
describe('passing no input', function()