fix(lazygit): dont use <esc><esc> for normal more for laygit to prevent delays on <esc>. Fixes #567

This commit is contained in:
Folke Lemaitre
2023-04-16 11:18:44 +02:00
parent 2d8116ef67
commit a9e9204dae
2 changed files with 8 additions and 6 deletions

View File

@ -102,15 +102,17 @@ function M.telescope(builtin, opts)
end
end
-- FIXME: create a togglable terminal
-- Opens a floating terminal (interactive by default)
---@param cmd? string[]|string
---@param opts? LazyCmdOptions|{interactive?:boolean}
---@param opts? LazyCmdOptions|{interactive?:boolean, esc_esc?:false}
function M.float_term(cmd, opts)
opts = vim.tbl_deep_extend("force", {
size = { width = 0.9, height = 0.9 },
}, opts or {})
require("lazy.util").float_term(cmd, opts)
local float = require("lazy.util").float_term(cmd, opts)
if opts.esc_esc == false then
vim.keymap.set("t", "<esc>", "<esc>", { buffer = float.buf, nowait = true })
end
end
---@param silent boolean?