fix(docs): missing @returns desc in _meta/api.lua #30673

This commit is contained in:
Justin M. Keyes
2024-10-05 08:52:57 -07:00
committed by GitHub
parent 0c9b3ef34d
commit 8801b77ed0
3 changed files with 267 additions and 98 deletions

View File

@@ -173,6 +173,19 @@ local function parse_md(text)
return extract(root) or {}
end
--- Prefixes each line in `text`.
---
--- Does not wrap, that's not important for "meta" files? (You probably want md_to_vimdoc instead.)
---
--- @param text string
--- @param prefix_ string
function M.prefix(prefix_, text)
if (text):find('\n$') then
return text:gsub('([^\n]*)[\t ]*\n', prefix_ .. '%1\n')
end
return prefix_ .. text:gsub('([^\n]*)[\t ]*\n', '%1\n' .. prefix_)
end
--- @param x string
--- @param start_indent integer
--- @param indent integer