Updated theme selector
This commit is contained in:
@@ -13,18 +13,17 @@ local filechange = augroup("filechange", { clear = true })
|
||||
cmd("SetTheme", function(arg)
|
||||
local themeselected = arg.fargs[1]
|
||||
|
||||
local getallthemes = themefuncs.getAllThemes()
|
||||
for _, theme in ipairs(getallthemes) do
|
||||
if theme == themeselected then
|
||||
vim.cmd("colorscheme " .. themeselected)
|
||||
themefuncs.applytofile(themeselected)
|
||||
end
|
||||
local allthemes = themefuncs.get_all_themes()
|
||||
if vim.tbl_contains(allthemes, themeselected) then
|
||||
themefuncs.change_theme(themeselected)
|
||||
else
|
||||
vim.notify("Invalid selection", vim.log.levels.ERROR)
|
||||
end
|
||||
end, {
|
||||
desc = "Select a theme",
|
||||
nargs = 1,
|
||||
complete = function()
|
||||
local getallthemes = themefuncs.getAllThemes()
|
||||
local getallthemes = themefuncs.get_all_themes()
|
||||
return getallthemes
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user