fix(api): nvim_cmd() "args" type too narrow #40670

Problem: nvim_cmd() accepts number/boolean in args and converts them
to strings, but the keyset declares ArrayOf(String).

Solution: use ArrayOf(Union(Integer, String, Boolean)) and wrap union
types in parens when generating array annotations.
This commit is contained in:
glepnir
2026-07-11 08:34:08 +08:00
committed by GitHub
parent 784765cb73
commit 59dbca9b0c
3 changed files with 6 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ error('Cannot require a meta file')
--- @class vim.api.keyset.cmd
--- @field addr? "line"|"arg"|"buf"|"load"|"win"|"tab"|"qf"|"none"|"?"
--- @field args? string[]
--- @field args? (integer|string|boolean)[]
--- @field bang? boolean
--- @field cmd? string
--- @field count? integer