aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_eval_files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen_eval_files.lua')
-rwxr-xr-xscripts/gen_eval_files.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/gen_eval_files.lua b/scripts/gen_eval_files.lua
index 76092f8b39..b490e7b480 100755
--- a/scripts/gen_eval_files.lua
+++ b/scripts/gen_eval_files.lua
@@ -432,14 +432,15 @@ local function render_eval_meta(f, fun, write)
end
--- @param name string
+--- @param name_tag boolean
--- @param fun vim.EvalFn
--- @param write fun(line: string)
-local function render_sig_and_tag(name, fun, write)
+local function render_sig_and_tag(name, name_tag, fun, write)
if not fun.signature then
return
end
- local tags = { '*' .. name .. '()*' }
+ local tags = name_tag and { '*' .. name .. '()*' } or {}
if fun.tags then
for _, t in ipairs(fun.tags) do
@@ -447,6 +448,11 @@ local function render_sig_and_tag(name, fun, write)
end
end
+ if #tags == 0 then
+ write(fun.signature)
+ return
+ end
+
local tag = table.concat(tags, ' ')
local siglen = #fun.signature
local conceal_offset = 2 * (#tags - 1)
@@ -472,11 +478,7 @@ local function render_eval_doc(f, fun, write)
return
end
- if f:find('__%d+$') then
- write(fun.signature)
- else
- render_sig_and_tag(fun.name or f, fun, write)
- end
+ render_sig_and_tag(fun.name or f, not f:find('__%d+$'), fun, write)
if not fun.desc then
return