fix(lua): avoid recursive vim.on_key() callback (#30753)

This commit is contained in:
zeertzjq
2024-10-12 08:07:05 +08:00
committed by GitHub
parent c49030b75a
commit 0e42c81c7f
5 changed files with 55 additions and 0 deletions

View File

@ -658,6 +658,8 @@ local on_key_cbs = {} --- @type table<integer,function>
--- and cannot be toggled dynamically.
---
---@note {fn} will be removed on error.
---@note {fn} won't be invoked recursively, i.e. if {fn} itself consumes input,
--- it won't be invoked for those keys.
---@note {fn} will not be cleared by |nvim_buf_clear_namespace()|
---
---@param fn fun(key: string, typed: string)?