From 3198038224209c41932a305e2a2dee708d4e3ec8 Mon Sep 17 00:00:00 2001 From: altermo <107814000+altermo@users.noreply.github.com> Date: Tue, 7 Nov 2023 01:33:38 +0100 Subject: fix(lua): correct return value for on_key with no arguments (#25911) --- runtime/lua/vim/_editor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 0da127b18f..0bdf0c90a5 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -650,7 +650,7 @@ local on_key_cbs = {} ---if on_key() is called without arguments. function vim.on_key(fn, ns_id) if fn == nil and ns_id == nil then - return #on_key_cbs + return vim.tbl_count(on_key_cbs) end vim.validate({ -- cgit