Skip to content

Commit

Permalink
Merge pull request #24 from tami5/feat/select/override_telescope_config
Browse files Browse the repository at this point in the history
feat(select): override telescope config
  • Loading branch information
stevearc authored Mar 17, 2022
2 parents 6006de7 + 4f36284 commit a566ab5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lua/dressing/select/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ M.select = function(config, items, opts, on_choice)
}
end

local picker_opts = type(config.theme) == "table"
and vim.tbl_extend("force", config.theme, defaults)
or themes[string.format("get_%s", config.theme)](defaults)
local theme, ttype = nil, type(config.theme)
if ttype == "string" then
theme = themes[string.format("get_%s", config.theme)]
elseif ttype == "function" then
theme = config.theme
else
theme = function(s)
return vim.tbl_extend("keep", s, config.theme or {})
end
end

local picker_opts = vim.tbl_extend("keep", config, theme({ previewer = false }))


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

0 comments on commit a566ab5

Please sign in to comment.