From 805dd5d0478011dbfda4037b3778fb211cf7b620 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 10 Sep 2025 12:22:31 +0200 Subject: [PATCH] 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. --- src/gen/gen_eval_files.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gen/gen_eval_files.lua b/src/gen/gen_eval_files.lua index 5ff07a0f53..f9e721b1ba 100755 --- a/src/gen/gen_eval_files.lua +++ b/src/gen/gen_eval_files.lua @@ -178,7 +178,7 @@ local function get_api_meta() --- @type table 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