docs(lua): typing for vim.fn.winlayout #33817

Problem:
`any[]` means nothing, and the return value is not the same as what's
documented in the comment (eg, Lua returns `{ "row", { { "leaf", 1000 },
{ "leaf", 1001 } } }`, not `{ "row", { "leaf", 1000, "leaf", 1001 } }`)

Solution:
Create two classes (vim.fn.winlayout.leaf and vim.fn.winlayout.branch)
and one alias that links the two together.

Also: Due to LuaLS limitations, there is an empty class,
vim.fn.winlayout.empty

Signed-Off-By: VoxelPrismatic <voxelprismatic@pm.me>
This commit is contained in:
PRIZ ;]
2025-05-03 13:34:25 -05:00
committed by GitHub
parent 403fcacfc1
commit 902b689c4d
4 changed files with 18 additions and 3 deletions

View File

@ -13321,7 +13321,7 @@ M.funcs = {
]=],
name = 'winlayout',
params = { { 'tabnr', 'integer' } },
returns = 'any[]',
returns = 'vim.fn.winlayout.ret',
signature = 'winlayout([{tabnr}])',
},
winline = {