diff --git a/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua b/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua index 3439cd1fb..27c59dc08 100644 --- a/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua +++ b/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua @@ -25,7 +25,6 @@ return { dependencies = { { "zbirenbaum/copilot.lua" }, { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope.nvim" }, { "AstroNvim/astrocore", ---@param opts AstroCoreOpts @@ -71,9 +70,14 @@ return { -- Helper function to create mappings local function create_mapping(action_type, selection_type) return function() - require("CopilotChat.integrations.telescope").pick(require("CopilotChat.actions")[action_type] { - selection = require("CopilotChat.select")[selection_type], - }) + local fzf_ok = pcall(require, "fzf-lua") + local snacks_ok = pcall(require, "snacks") + + require("CopilotChat.integrations." .. (fzf_ok and "fzflua" or snacks_ok and "snacks" or "telescope")).pick( + require("CopilotChat.actions")[action_type] { + selection = require("CopilotChat.select")[selection_type], + } + ) end end