mirror of
https://github.com/neovim/neovim.git
synced 2025-12-08 15:42:52 +00:00
feat(api): experimental nvim__exec_lua_fast #35758
Problem: Remote UIs can't execute lua code when a blocking prompt is waiting for input. This is needed when implementing IME pre-edit for example. Solution: Add an `nvim__exec_lua_fast` experimental API function, which is allowed to run instead of being queued until after the message has been shown.
This commit is contained in:
@@ -1674,6 +1674,30 @@ nvim__complete_set({index}, {opts}) *nvim__complete_set()*
|
||||
• winid: (number) floating window id
|
||||
• bufnr: (number) buffer id in floating window
|
||||
|
||||
nvim__exec_lua_fast({code}, {args}) *nvim__exec_lua_fast()*
|
||||
WARNING: This feature is experimental/unstable.
|
||||
|
||||
EXPERIMENTAL: this API may change or be removed in the future.
|
||||
|
||||
Like |nvim_exec_lua()|, but can be called during |api-fast| contexts.
|
||||
|
||||
Execute Lua code. Parameters (if any) are available as `...` inside the
|
||||
chunk. The chunk can return a value.
|
||||
|
||||
Only statements are executed. To evaluate an expression, prefix it with
|
||||
`return`: return my_function(...)
|
||||
|
||||
Attributes: ~
|
||||
|api-fast|
|
||||
|RPC| only
|
||||
|
||||
Parameters: ~
|
||||
• {code} (`string`) Lua code to execute
|
||||
• {args} (`any[]`) Arguments to the code
|
||||
|
||||
Return: ~
|
||||
(`any`) Return value of Lua code if present or NIL.
|
||||
|
||||
nvim__get_runtime({pat}, {all}, {opts}) *nvim__get_runtime()*
|
||||
Find files in runtime directories
|
||||
|
||||
|
||||
@@ -156,6 +156,8 @@ API
|
||||
• |nvim_echo()| can create |Progress| messages
|
||||
• |nvim_open_win()| floating windows can show a 'statusline'. Plugins can use
|
||||
`style='minimal'` or `:setlocal statusline=` to hide the statusline.
|
||||
• Added experimental |nvim__exec_lua_fast()| to allow remote API clients to
|
||||
execute code while nvim is blocking for input.
|
||||
|
||||
BUILD
|
||||
|
||||
|
||||
Reference in New Issue
Block a user