From 74998b0449c4df0494c3bfe5d4034c575d972406 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 3 Feb 2022 13:43:48 +0800 Subject: fix(event-loop): call vpeekc() directly first to check for character Expand mappings first by calling `vpeekc()` directly. --- test/functional/vimscript/timer_spec.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/functional/vimscript') 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 mapping', function() + local screen = Screen.new(40, 6) + screen:attach() + command([=[imap [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=]) + feed('i') + screen:expect({any='E605: Exception not caught: x'}) + end) end) -- cgit