refactor(init): replace synctex field and validation with reload

Problem: ProviderConfig still declared synctex and validated it, but
the field is being dropped in favour of the general-purpose reload.

Solution: replace the synctex annotation and vim.validate call with the
reload field, accepting boolean | string[] | function.
This commit is contained in:
Barrett Ruth 2026-03-03 16:23:47 -05:00
parent 6757c05dd2
commit 56e5a651de
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -9,6 +9,7 @@
---@field errors? false|'diagnostic'|'quickfix'
---@field clean? string[]|fun(ctx: preview.Context): string[]
---@field open? boolean|string[]
---@field reload? boolean|string[]|fun(ctx: preview.Context): string[]
---@class preview.Config
---@field debug boolean|string
@ -98,6 +99,7 @@ function M.setup(opts)
return x == nil or x == false or x == 'diagnostic' or x == 'quickfix'
end, 'false, "diagnostic", or "quickfix"')
vim.validate(prefix .. '.open', provider.open, { 'boolean', 'table' }, true)
vim.validate(prefix .. '.reload', provider.reload, { 'boolean', 'table', 'function' }, true)
end
config = vim.tbl_deep_extend('force', default_config, {