Skip to content

Commit

Permalink
feat: make trouble.nvim optional (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzaaft authored Oct 9, 2024
1 parent a8a9670 commit a54716b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/chatgpt/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ WELCOME_MESSAGE = [[
~ Robert Half
]]

function default_quickfix_cmd()
if pcall(require("trouble")) then
return "Trouble quickfix"
else
return "cope"
end
end

local M = {}
function M.defaults()
local defaults = {
Expand Down Expand Up @@ -180,7 +188,7 @@ function M.defaults()
use_openai_functions_for_edits = false,
ignore_default_actions_path = false,
actions_paths = {},
show_quickfixes_cmd = "Trouble quickfix",
show_quickfixes_cmd = default_quickfix_cmd(),
predefined_chat_gpt_prompts = "https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv",
highlights = {
help_key = "@symbol",
Expand Down

0 comments on commit a54716b

Please sign in to comment.