docs: stricter bufname and bufnr types (#27454)

This commit is contained in:
Maria José Solano
2024-02-12 20:15:27 -08:00
committed by GitHub
parent 4860cc5bdc
commit 1c7b0b9d5f
2 changed files with 4 additions and 4 deletions

View File

@@ -582,7 +582,7 @@ function vim.fn.bufloaded(buf) end
--- echo bufname("file2") " name of buffer where "file2" matches. --- echo bufname("file2") " name of buffer where "file2" matches.
--- < --- <
--- ---
--- @param buf? any --- @param buf? integer|string
--- @return string --- @return string
function vim.fn.bufname(buf) end function vim.fn.bufname(buf) end
@@ -599,7 +599,7 @@ function vim.fn.bufname(buf) end
--- number necessarily exist, because ":bwipeout" may have removed --- number necessarily exist, because ":bwipeout" may have removed
--- them. Use bufexists() to test for the existence of a buffer. --- them. Use bufexists() to test for the existence of a buffer.
--- ---
--- @param buf? any --- @param buf? integer|string
--- @param create? any --- @param create? any
--- @return integer --- @return integer
function vim.fn.bufnr(buf, create) end function vim.fn.bufnr(buf, create) end

View File

@@ -809,7 +809,7 @@ M.funcs = {
< <
]=], ]=],
name = 'bufname', name = 'bufname',
params = { { 'buf', 'any' } }, params = { { 'buf', 'integer|string' } },
returns = 'string', returns = 'string',
signature = 'bufname([{buf}])', signature = 'bufname([{buf}])',
}, },
@@ -832,7 +832,7 @@ M.funcs = {
]=], ]=],
name = 'bufnr', name = 'bufnr',
params = { { 'buf', 'any' }, { 'create', 'any' } }, params = { { 'buf', 'integer|string' }, { 'create', 'any' } },
returns = 'integer', returns = 'integer',
signature = 'bufnr([{buf} [, {create}]])', signature = 'bufnr([{buf} [, {create}]])',
}, },