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,
|
||||
})
|
||||
|
||||
@@ -9,11 +9,12 @@ function M.themeselector(opts)
|
||||
local action_state = require("telescope.actions.state")
|
||||
local action_set = require("telescope.actions.set")
|
||||
local ivytheme = require("telescope.themes").get_ivy()
|
||||
local prefs = require("taken.prefs")
|
||||
|
||||
local themes = themefuncs.get_all_themes()
|
||||
local change_theme = themefuncs.change_theme
|
||||
|
||||
local current_theme = vim.g.colors_name
|
||||
local current_theme = prefs.colorscheme
|
||||
|
||||
opts = opts or {}
|
||||
local combined = vim.tbl_extend("force", ivytheme, {
|
||||
|
||||
Reference in New Issue
Block a user