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.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/gen_eval_files.lua b/scripts/gen_eval_files.lua
index f888972f0d..58d3eeeadc 100755
--- a/scripts/gen_eval_files.lua
+++ b/scripts/gen_eval_files.lua
@@ -666,7 +666,16 @@ local function render_option_meta(_f, opt, write)
write('--- ' .. l)
end
- write('--- @type ' .. OPTION_TYPES[opt.type])
+ if opt.type == 'string' and not opt.list and opt.values then
+ local values = {} --- @type string[]
+ for _, e in ipairs(opt.values) do
+ values[#values + 1] = fmt("'%s'", e)
+ end
+ write('--- @type ' .. table.concat(values, '|'))
+ else
+ write('--- @type ' .. OPTION_TYPES[opt.type])
+ end
+
write('vim.o.' .. opt.full_name .. ' = ' .. render_option_default(opt.defaults))
if opt.abbreviation then
write('vim.o.' .. opt.abbreviation .. ' = vim.o.' .. opt.full_name)