Skip to content

Commit

Permalink
feat(trouble): switch to v3 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
nisavid committed Apr 4, 2024
1 parent 7b67e2c commit a0a6bae
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
"trouble.nvim": { "branch": "dev", "commit": "10eff94809ecd6ee6cc59f42e9521b9b8a14e9ce" },
"tsc.nvim": { "branch": "main", "commit": "02856f0c67741a7c060df8f24a7f2806e1935f46" },
"typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" },
"venv-selector.nvim": { "branch": "main", "commit": "3c57922256e7e26205a25f5a42ecf7104d9f2c78" },
Expand Down
38 changes: 37 additions & 1 deletion lua/community.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,44 @@ return {
{ import = "astrocommunity.diagnostics.trouble-nvim" },
{
"folke/trouble.nvim",
branch = "dev",
dependencies = {
{
"AstroNvim/astrocore",
opts = function(_, opts)
local mappings = opts.mappings
local prefix = "<Leader>x"
mappings.n[prefix] = {
desc = require("astroui").get_icon("Trouble", 1, true) .. "Trouble",
}
mappings.n[prefix .. "x"] = {
"<Cmd>Trouble diagnostics toggle<CR>",
desc = "Diagnostics",
}
mappings.n[prefix .. "X"] = {
"<Cmd>Trouble diagnostics toggle filter.buf=0<CR>",
desc = "Buffer Diagnostics",
}
mappings.n[prefix .. "l"] = {
"<Cmd>Trouble loclist toggle<CR>",
desc = "Location List",
}
mappings.n[prefix .. "q"] = {
"<Cmd>Trouble qflist toggle<CR>",
desc = "Quickfix List",
}
mappings.n[prefix .. "cl"] = {
"<Cmd>Trouble symbols toggle focus=false<CR>",
desc = "Symbols",
}
mappings.n[prefix .. "cl"] = {
"<Cmd>Trouble lsp toggle focus=false win.position=right<CR>",
desc = "LSP Definitions / references / ...",
}
end,
},
},
opts = {
mode = "document_diagnostics",
auto_open = true,
auto_close = true,
},
Expand Down
8 changes: 0 additions & 8 deletions lua/plugins/astrocore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,6 @@ return {
-- Disable `alpha_autostart` due to incompatibility
-- with `restore_session` (below)
alpha_autostart = false,
-- Workaround for https://github.com/folke/trouble.nvim/issues/253
close_trouble_before_quit = {
desc = "Close Trouble window before quitting",
event = "QuitPre",
callback = function()
if require("lazy.core.config").plugins["trouble.nvim"]._.loaded then vim.cmd.TroubleClose() end
end,
},
cursorlines_only_in_curr_win = {
{
desc = "Enable cursorcolumn/cursorline in current window",
Expand Down

0 comments on commit a0a6bae

Please sign in to comment.