fix(gen): prevent "make doc" failure due to temporary files

Notably, the existence of a swap file like .buffer.c.swp might cause
mayhem. As a reasonable filter, only process *.c and *.h files using the
c grammar.
This commit is contained in:
bfredl
2025-09-10 12:22:31 +02:00
parent e084a99040
commit 805dd5d047

View File

@@ -178,7 +178,7 @@ local function get_api_meta()
--- @type table<string,nvim.cdoc.parser.fun>
local functions = {}
for path, ty in vim.fs.dir(f) do
if ty == 'file' then
if ty == 'file' and (vim.endswith(path, '.c') or vim.endswith(path, '.h')) then
local filename = vim.fs.joinpath(f, path)
local _, funs = cdoc_parser.parse(filename)
for _, fn in ipairs(funs) do