aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_editor.lua
diff options
context:
space:
mode:
authoraltermo <107814000+altermo@users.noreply.github.com>2023-11-07 01:33:38 +0100
committerGitHub <noreply@github.com>2023-11-07 08:33:38 +0800
commit3198038224209c41932a305e2a2dee708d4e3ec8 (patch)
tree6447921fae60fe1a008b861b1519f817d8252922 /runtime/lua/vim/_editor.lua
parent88ed9ffcd1c022811ebc8818e153fe94e4741671 (diff)
downloadrneovim-3198038224209c41932a305e2a2dee708d4e3ec8.tar.gz
rneovim-3198038224209c41932a305e2a2dee708d4e3ec8.tar.bz2
rneovim-3198038224209c41932a305e2a2dee708d4e3ec8.zip
fix(lua): correct return value for on_key with no arguments (#25911)
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
-rw-r--r--runtime/lua/vim/_editor.lua2
1 files changed, 1 insertions, 1 deletions
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({