mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(api): generic error messages, not using TRY_WRAP #31596
Problem: - API functions using `try_start` directly, do not surface the underlying error message, and instead show generic messages. - Error-handling code is duplicated in the API impl. - Failure modes are not tested. Solution: - Use `TRY_WRAP`. - Add tests.
This commit is contained in:
6
runtime/lua/vim/_meta/api.lua
generated
6
runtime/lua/vim/_meta/api.lua
generated
@@ -885,10 +885,8 @@ function vim.api.nvim_cmd(cmd, opts) end
|
||||
---
|
||||
--- On execution error: fails with Vimscript error, updates v:errmsg.
|
||||
---
|
||||
--- Prefer using `nvim_cmd()` or `nvim_exec2()` over this. To evaluate multiple lines of Vim script
|
||||
--- or an Ex command directly, use `nvim_exec2()`. To construct an Ex command using a structured
|
||||
--- format and then execute it, use `nvim_cmd()`. To modify an Ex command before evaluating it, use
|
||||
--- `nvim_parse_cmd()` in conjunction with `nvim_cmd()`.
|
||||
--- Prefer `nvim_cmd()` or `nvim_exec2()` instead. To modify an Ex command in a structured way
|
||||
--- before executing it, modify the result of `nvim_parse_cmd()` then pass it to `nvim_cmd()`.
|
||||
---
|
||||
--- @param command string Ex command string
|
||||
function vim.api.nvim_command(command) end
|
||||
|
Reference in New Issue
Block a user