Skip to content

Commit

Permalink
feat: allow disabling a key
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jul 21, 2024
1 parent 1f71d71 commit 891e76d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/trouble/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ local defaults = {
},
-- Key mappings can be set to the name of a builtin action,
-- or you can define your own custom action.
---@type table<string, trouble.Action.spec>
---@type table<string, trouble.Action.spec|false>
keys = {
["?"] = "help",
r = "refresh",
Expand Down
4 changes: 3 additions & 1 deletion lua/trouble/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ function M:on_mount()
end, { pattern = "foldlevel", buffer = false })

for k, v in pairs(self.opts.keys) do
self:map(k, v)
if v ~= false then
self:map(k, v)
end
end

self.win:map("<leftmouse>", function()
Expand Down

0 comments on commit 891e76d

Please sign in to comment.