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:
parent
6757c05dd2
commit
56e5a651de
1 changed files with 2 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
---@field errors? false|'diagnostic'|'quickfix'
|
---@field errors? false|'diagnostic'|'quickfix'
|
||||||
---@field clean? string[]|fun(ctx: preview.Context): string[]
|
---@field clean? string[]|fun(ctx: preview.Context): string[]
|
||||||
---@field open? boolean|string[]
|
---@field open? boolean|string[]
|
||||||
|
---@field reload? boolean|string[]|fun(ctx: preview.Context): string[]
|
||||||
|
|
||||||
---@class preview.Config
|
---@class preview.Config
|
||||||
---@field debug boolean|string
|
---@field debug boolean|string
|
||||||
|
|
@ -98,6 +99,7 @@ function M.setup(opts)
|
||||||
return x == nil or x == false or x == 'diagnostic' or x == 'quickfix'
|
return x == nil or x == false or x == 'diagnostic' or x == 'quickfix'
|
||||||
end, 'false, "diagnostic", or "quickfix"')
|
end, 'false, "diagnostic", or "quickfix"')
|
||||||
vim.validate(prefix .. '.open', provider.open, { 'boolean', 'table' }, true)
|
vim.validate(prefix .. '.open', provider.open, { 'boolean', 'table' }, true)
|
||||||
|
vim.validate(prefix .. '.reload', provider.reload, { 'boolean', 'table', 'function' }, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
config = vim.tbl_deep_extend('force', default_config, {
|
config = vim.tbl_deep_extend('force', default_config, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue