mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
docs: correct on_key docs (#27429)
This commit is contained in:
@@ -1622,9 +1622,9 @@ vim.on_key({fn}, {ns_id}) *vim.on_key()*
|
|||||||
• {fn} will receive the keys after mappings have been evaluated
|
• {fn} will receive the keys after mappings have been evaluated
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {fn} (`fun(key: string)`) Function invoked on every key press.
|
• {fn} (`fun(key: string)?`) Function invoked on every key press.
|
||||||
|i_CTRL-V| Returning nil removes the callback associated with
|
|i_CTRL-V| Passing in nil when {ns_id} is specified removes
|
||||||
namespace {ns_id}.
|
the callback associated with namespace {ns_id}.
|
||||||
• {ns_id} (`integer?`) Namespace ID. If nil or 0, generates and returns
|
• {ns_id} (`integer?`) Namespace ID. If nil or 0, generates and returns
|
||||||
a new |nvim_create_namespace()| id.
|
a new |nvim_create_namespace()| id.
|
||||||
|
|
||||||
|
@@ -652,8 +652,9 @@ local on_key_cbs = {}
|
|||||||
---@note {fn} will not be cleared by |nvim_buf_clear_namespace()|
|
---@note {fn} will not be cleared by |nvim_buf_clear_namespace()|
|
||||||
---@note {fn} will receive the keys after mappings have been evaluated
|
---@note {fn} will receive the keys after mappings have been evaluated
|
||||||
---
|
---
|
||||||
---@param fn fun(key: string) Function invoked on every key press. |i_CTRL-V|
|
---@param fn fun(key: string)? Function invoked on every key press. |i_CTRL-V|
|
||||||
--- Returning nil removes the callback associated with namespace {ns_id}.
|
--- Passing in nil when {ns_id} is specified removes the
|
||||||
|
--- callback associated with namespace {ns_id}.
|
||||||
---@param ns_id integer? Namespace ID. If nil or 0, generates and returns a
|
---@param ns_id integer? Namespace ID. If nil or 0, generates and returns a
|
||||||
--- new |nvim_create_namespace()| id.
|
--- new |nvim_create_namespace()| id.
|
||||||
---
|
---
|
||||||
|
Reference in New Issue
Block a user