aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/timer_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-03 13:43:48 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-03 13:43:48 +0800
commit74998b0449c4df0494c3bfe5d4034c575d972406 (patch)
tree17b7c5603cdb095a1b88f837a1d8bf91f3d5e6db /test/functional/vimscript/timer_spec.lua
parent21cdecc8e0233d7a99d971327d21f701dbd65ba1 (diff)
downloadrneovim-74998b0449c4df0494c3bfe5d4034c575d972406.tar.gz
rneovim-74998b0449c4df0494c3bfe5d4034c575d972406.tar.bz2
rneovim-74998b0449c4df0494c3bfe5d4034c575d972406.zip
fix(event-loop): call vpeekc() directly first to check for character
Expand mappings first by calling `vpeekc()` directly.
Diffstat (limited to 'test/functional/vimscript/timer_spec.lua')
-rw-r--r--test/functional/vimscript/timer_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua
index e45b64422f..25e46062b7 100644
--- a/test/functional/vimscript/timer_spec.lua
+++ b/test/functional/vimscript/timer_spec.lua
@@ -272,4 +272,12 @@ describe('timers', function()
]]
eq("Vim(call):E48: Not allowed in sandbox", exc_exec("sandbox call timer_start(0, 'Scary')"))
end)
+
+ it('can be triggered after an empty string <expr> mapping', function()
+ local screen = Screen.new(40, 6)
+ screen:attach()
+ command([=[imap <expr> <F2> [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=])
+ feed('i<F2>')
+ screen:expect({any='E605: Exception not caught: x'})
+ end)
end)