Merge pull request #24 from tami5/feat/select/override_telescope_config
feat(select): override telescope config
This commit is contained in:
commit
a566ab5dd1
|
@ -23,9 +23,19 @@ M.select = function(config, items, opts, on_choice)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local picker_opts = type(config.theme) == "table"
|
local theme, ttype = nil, type(config.theme)
|
||||||
and vim.tbl_extend("force", config.theme, defaults)
|
if ttype == "string" then
|
||||||
or themes[string.format("get_%s", config.theme)](defaults)
|
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, {
|
pickers.new(picker_opts, {
|
||||||
prompt_title = opts.prompt,
|
prompt_title = opts.prompt,
|
||||||
|
|
Loading…
Reference in New Issue