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/timer_spec.lua') 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 From a9665bb12cd8cbacbc6ef6df66c1989b0c6f9fcc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Mar 2022 05:25:00 +0800 Subject: fix(event-loop): duplicate display updating logic in vgetorpeek() (#17913) --- test/functional/vimscript/timer_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/vimscript/timer_spec.lua') diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index 25e46062b7..20f2afb20f 100644 --- a/test/functional/vimscript/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua @@ -273,7 +273,7 @@ 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() + it('can be triggered after an empty string mapping #17257', function() local screen = Screen.new(40, 6) screen:attach() command([=[imap [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=]) -- cgit From f50135a32e11c535e1dc3a8e9460c5b4e640ee86 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 30 Jun 2022 13:16:46 +0200 Subject: feat: stdpath('run'), /tmp/nvim.user/ #18993 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093 --- test/functional/vimscript/timer_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/vimscript/timer_spec.lua') diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index 20f2afb20f..5463cfb234 100644 --- a/test/functional/vimscript/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua @@ -96,7 +96,7 @@ describe('timers', function() nvim_async("command", "let g:val = 0 | let g:c = getchar()") retry(nil, nil, function() local val = eval("g:val") - ok(val >= 2, "expected >= 2, got: "..tostring(val)) + ok(val >= 2, '>= 2', tostring(val)) eq(0, eval("getchar(1)")) end) feed("c") -- cgit