Skip to content

Commit

Permalink
fix(telescope): allow passing theme options
Browse files Browse the repository at this point in the history
to telescope picker
  • Loading branch information
akinsho committed Feb 26, 2022
1 parent 8e8f7e5 commit c49854a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/dressing/select/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ M.is_supported = function()
return pcall(require, "telescope")
end

local defaults = { previewer = false }

M.select = function(config, items, opts, on_choice)
local themes = require("telescope.themes")
local actions = require("telescope.actions")
Expand All @@ -21,9 +23,10 @@ M.select = function(config, items, opts, on_choice)
}
end

local picker_opts = themes[string.format("get_%s", config.theme)]({
previewer = false,
})
local picker_opts = type(config.theme) == "table"
and vim.tbl_extend("force", config.theme, defaults)
or themes[string.format("get_%s", config.theme)](defaults)

pickers.new(picker_opts, {
prompt_title = opts.prompt,
finder = finders.new_table({
Expand Down

0 comments on commit c49854a

Please sign in to comment.