local Config = require("lazyvim.config") for _, other in ipairs({ "aerial", "outline" }) do local extra = "lazyvim.plugins.extras.editor." .. other if vim.tbl_contains(Config.json.data.extras, extra) then other = other:gsub("^%l", string.upper) LazyVim.error({ "**Trouble v3** includes support for document symbols.", ("You currently have the **%s** extra enabled."):format(other), "Please disable it in your config.", }) end end return { { "folke/trouble.nvim", branch = "dev", keys = { { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, }, }, -- lualine integration { "nvim-lualine/lualine.nvim", optional = true, opts = function(_, opts) local trouble = require("trouble") if not trouble.statusline then LazyVim.error("You have enabled the **trouble-v3** extra,\nbut still need to update it with `:Lazy`") return end local symbols = trouble.statusline({ mode = "symbols", groups = {}, title = false, filter = { range = true }, format = "{kind_icon}{symbol.name:Normal}", }) table.insert(opts.sections.lualine_c, { symbols.get, cond = symbols.has, }) end, }, { "folke/edgy.nvim", optional = true, opts = function(_, opts) -- disable for now do return end for _, pos in ipairs({ "top", "bottom", "left", "right" }) do opts[pos] = opts[pos] or {} table.insert(opts[pos], { ft = "trouble", filter = function(_buf, win) return vim.w[win].trouble and vim.w[win].trouble.position == pos and vim.w[win].trouble.type == "split" and vim.w[win].trouble.relative == "editor" and not vim.w[win].trouble_preview end, }) end end, }, }