Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add theme options to select Telescope themes #710

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lua/CopilotChat/integrations/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@ local M = {}
--- Pick an action from a list of actions
---@param pick_actions CopilotChat.integrations.actions?: A table with the actions to pick from
---@param opts table?: Telescope options
function M.pick(pick_actions, opts)
---@param theme string?: Telescope theme
function M.pick(pick_actions, opts, theme)
if not pick_actions or not pick_actions.actions or vim.tbl_isempty(pick_actions.actions) then
return
end

utils.return_to_normal_mode()
opts = themes.get_dropdown(opts or {})
theme = theme or 'dropdown'
local theme_functions = {
dropdown = themes.get_dropdown,
ivy = themes.get_ivy,
cursor = themes.get_cursor,
}

opts = (theme_functions[theme] or themes.get_dropdown)(opts or {})

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