Updated themeswitcher

This commit is contained in:
2024-10-15 18:57:18 +02:00
parent 8e1a76663e
commit d27fa532dc

View File

@@ -7,7 +7,7 @@ function M.themeselector(opts)
local conf = require("telescope.config").values local conf = require("telescope.config").values
local actions = require("telescope.actions") local actions = require("telescope.actions")
local action_state = require("telescope.actions.state") local action_state = require("telescope.actions.state")
local action_set = require("telescope.actions.set") -- local action_set = require("telescope.actions.set")
local configDir = vim.fn.stdpath("config") local configDir = vim.fn.stdpath("config")
local prefsFile = configDir .. "/lua/taken/prefs.lua" local prefsFile = configDir .. "/lua/taken/prefs.lua"
@@ -29,15 +29,15 @@ function M.themeselector(opts)
local selection = action_state.get_selected_entry() local selection = action_state.get_selected_entry()
applytofile(selection.value, prefsFile) applytofile(selection.value, prefsFile)
end) end)
action_set.shift_selection:enhance({ -- action_set.shift_selection:enhance({
post = function() -- post = function()
local selection = action_state.get_selected_entry() -- local selection = action_state.get_selected_entry()
if selection == nil then -- if selection == nil then
vim.notify("Error while selecting theme", vim.log.levels.ERROR) -- vim.notify("Error while selecting theme", vim.log.levels.ERROR)
end -- end
vim.cmd("colorscheme " .. selection.value) -- vim.cmd("colorscheme " .. selection.value)
end, -- end,
}) -- })
-- actions.close:enhance({ -- actions.close:enhance({
-- post = function() -- post = function()
-- local selection = action_state.get_selected_entry() -- local selection = action_state.get_selected_entry()