Skip to content

Commit ebe3bd0

Browse files
committed
feat: add deprecation warnings for updated options
1 parent a16bbb4 commit ebe3bd0

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

lua/cyberdream/config.lua

+43-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,49 @@ M.options = {}
108108

109109
---@param options Config|nil
110110
function M.setup(options)
111-
M.options = vim.tbl_deep_extend("force", {}, default_options, options or {})
111+
options = options or {}
112+
113+
-- Handle deprecated options TODO: Remove post v5.0.0 release
114+
---@diagnostic disable: undefined-field
115+
if options.borderless_telescope ~= nil then
116+
vim.defer_fn(function()
117+
vim.notify(
118+
"The 'borderless_telescope' is deprecated!\n\nUse 'borderless_pickers' instead.",
119+
3,
120+
{ title = "cyberdream.nvim" }
121+
)
122+
end, 1000)
123+
options.borderless_pickers = options.borderless_telescope
124+
end
125+
126+
if options.theme then
127+
vim.defer_fn(function()
128+
vim.notify(
129+
"The 'theme' table is deprecated!\n\nMove any 'theme' options to the main 'opts' table instead.",
130+
3,
131+
{ title = "cyberdream.nvim" }
132+
)
133+
end, 1000)
134+
135+
if options.theme.variant then
136+
options.variant = options.theme.variant
137+
end
138+
if options.theme.saturation then
139+
options.saturation = options.theme.saturation
140+
end
141+
if options.theme.colors then
142+
options.colors = options.theme.colors
143+
end
144+
if options.theme.highlights then
145+
options.highlights = options.theme.highlights
146+
end
147+
if options.theme.overrides then
148+
options.overrides = options.theme.overrides
149+
end
150+
end
151+
---@diagnostic enable: undefined-field
152+
153+
M.options = vim.tbl_deep_extend("force", {}, default_options, options)
112154
vim.g.cyberdream_opts = M.options
113155
end
114156

0 commit comments

Comments
 (0)