fix(lua): correct return value for on_key with no arguments (#25911)

This commit is contained in:
altermo
2023-11-07 01:33:38 +01:00
committed by GitHub
parent 88ed9ffcd1
commit 3198038224
2 changed files with 7 additions and 1 deletions

View File

@@ -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({