feat(ui): added custom commands for lazygit and opening a terminal for a plugin

This commit is contained in:
Folke Lemaitre 2022-12-24 11:28:19 +01:00
parent 7d02da2ff0
commit be3909c544
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
4 changed files with 61 additions and 7 deletions

View file

@ -96,12 +96,14 @@ function M.create(opts)
end)
for key, handler in pairs(Config.options.ui.custom_keys) do
self:on_key(key, function()
local plugin = self.render:get_plugin()
if plugin then
handler(plugin)
end
end)
if handler then
self:on_key(key, function()
local plugin = self.render:get_plugin()
if plugin then
handler(plugin)
end
end)
end
end
self:setup_patterns()