Skip to content

Commit

Permalink
fix(trouble-nvim): prevent clashes with existing <Leader>x mappings (
Browse files Browse the repository at this point in the history
…#1105)

This is to avoid clashes with the [recent addition of `<Leader>x` to AstroNvim](AstroNvim/AstroNvim@99c2b13).
  • Loading branch information
rami3l authored Jul 13, 2024
1 parent 26bd7b4 commit 081a98b
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lua/astrocommunity/diagnostics/trouble-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,15 @@ return {
opts = function(_, opts)
local maps = opts.mappings
local prefix = "<Leader>x"
maps.n[prefix] = { desc = require("astroui").get_icon("Trouble", 1, true) .. "Trouble" }
maps.n[prefix .. "X"] = { "<Cmd>Trouble diagnostics toggle<CR>", desc = "Workspace Diagnostics (Trouble)" }
maps.n[prefix .. "X"] = { "<Cmd>Trouble diagnostics toggle<CR>", desc = "Trouble Workspace Diagnostics" }
maps.n[prefix .. "x"] =
{ "<Cmd>Trouble diagnostics toggle filter.buf=0<CR>", desc = "Document Diagnostics (Trouble)" }
maps.n[prefix .. "l"] = { "<Cmd>Trouble loclist toggle<CR>", desc = "Location List (Trouble)" }
maps.n[prefix .. "q"] = { "<Cmd>Trouble quickfix toggle<CR>", desc = "Quickfix List (Trouble)" }
{ "<Cmd>Trouble diagnostics toggle filter.buf=0<CR>", desc = "Trouble Document Diagnostics" }
maps.n[prefix .. "L"] = { "<Cmd>Trouble loclist toggle<CR>", desc = "Trouble Location List" }
maps.n[prefix .. "Q"] = { "<Cmd>Trouble quickfix toggle<CR>", desc = "Trouble Quickfix List" }
if require("astrocore").is_available "todo-comments.nvim" then
maps.n[prefix .. "t"] = {
"<cmd>Trouble todo<cr>",
desc = "Todo (Trouble)",
}
maps.n[prefix .. "T"] = {
"<cmd>Trouble todo filter={tag={TODO,FIX,FIXME}}<cr>",
desc = "Todo/Fix/Fixme (Trouble)",
}
maps.n[prefix .. "t"] = { "<cmd>Trouble todo<cr>", desc = "Trouble Todo" }
maps.n[prefix .. "T"] =
{ "<cmd>Trouble todo filter={tag={TODO,FIX,FIXME}}<cr>", desc = "Trouble Todo/Fix/Fixme" }
end
end,
},
Expand Down

0 comments on commit 081a98b

Please sign in to comment.