commit b3342171d533f3d9dd33bbe5ff09f0d7b007f5a3
parent 883e2a1409feb3420f333c56446f0dbb49cd47cb
Author: Lewis Russell <lewis6991@gmail.com>
Date: Sat, 16 Sep 2023 11:43:02 +0100
fix(typing): vim.fn.execute
Diffstat:
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
@@ -1630,9 +1630,9 @@ function vim.fn.executable(expr) end
--- To execute a command in another window than the current one
--- use `win_execute()`.
---
---- @param command any
---- @param silent? boolean
---- @return any
+--- @param command string|string[]
+--- @param silent? ''|'silent'|'silent!'
+--- @return string
function vim.fn.execute(command, silent) end
--- Returns the full path of {expr} if it is an executable and
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
@@ -2111,7 +2111,11 @@ M.funcs = {
]=],
name = 'execute',
- params = { { 'command', 'any' }, { 'silent', 'boolean' } },
+ params = {
+ { 'command', 'string|string[]' },
+ { 'silent', "''|'silent'|'silent!'" }
+ },
+ returns = 'string',
signature = 'execute({command} [, {silent}])',
},
exepath = {