Skip to content

Commit 20ea86e

Browse files
fernandoalexandref-person
authored andcommitted
Update vim.validate usages to avoid deprecated warning
Fixed :checkhealth warning: vim.validate is deprecated. Feature will be removed in Nvim 1.0 ADVICE: use vim.validate(name, value, validator, optional_or_msg) instead. stack traceback: /home/fea/.local/share/nvim/lazy/auto-dark-mode.nvim/lua/auto-dark-mode/init.lua:22 /home/fea/.local/share/nvim/lazy/auto-dark-mode.nvim/lua/auto-dark-mode/init.lua:163 /home/fea/.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:387
1 parent c31de12 commit 20ea86e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

lua/auto-dark-mode/init.lua

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@ local default_options = {
1919

2020
---@param options AutoDarkModeOptions
2121
local function validate_options(options)
22-
vim.validate({
23-
fallback = {
24-
options.fallback,
25-
function(opt)
26-
return vim.tbl_contains({ "dark", "light" }, opt)
27-
end,
28-
"`fallback` to be either 'light' or 'dark'",
29-
},
30-
set_dark_mode = { options.set_dark_mode, "function" },
31-
set_light_mode = { options.set_light_mode, "function" },
32-
update_interval = { options.update_interval, "number" },
33-
})
22+
vim.validate("fallback", options.fallback, function(opt)
23+
return vim.tbl_contains({ "dark", "light" }, opt)
24+
end, "`fallback` to be either 'light' or 'dark'")
25+
vim.validate("set_dark_mode", options.set_dark_mode, "function")
26+
vim.validate("set_light_mode", options.set_light_mode, "function")
27+
vim.validate("update_interval", options.update_interval, "number")
3428

3529
M.state.setup_correct = true
3630
end

0 commit comments

Comments
 (0)