diff --git a/lua/jj/cmd/init.lua b/lua/jj/cmd/init.lua index 061b96f..bac28dd 100644 --- a/lua/jj/cmd/init.lua +++ b/lua/jj/cmd/init.lua @@ -5,7 +5,6 @@ local utils = require("jj.utils") local runner = require("jj.core.runner") local parser = require("jj.core.parser") local terminal = require("jj.ui.terminal") -local editor = require("jj.ui.editor") local diff = require("jj.diff") local log_module = require("jj.cmd.log") local describe_module = require("jj.cmd.describe") @@ -265,7 +264,7 @@ function M.diff(opts) end end - terminal.run(cmd) + terminal.run(cmd, M.close_keymaps()) end -- Jujutsu rebase @@ -385,13 +384,13 @@ function M.j(args) true ) if not success then - terminal.run("jj") + terminal.run("jj", M.close_keymaps()) return end local default_cmd = parser.parse_default_cmd(default_cmd_str and default_cmd_str or "") if default_cmd == nil then - terminal.run("jj") + terminal.run("jj", M.close_keymaps()) return end args = default_cmd @@ -449,7 +448,7 @@ function M.j(args) if handlers[subcommand] then handlers[subcommand]() else - terminal.run(cmd) + terminal.run(cmd, M.close_keymaps()) end end diff --git a/lua/jj/cmd/log.lua b/lua/jj/cmd/log.lua index 5255fa7..0e69c8f 100644 --- a/lua/jj/cmd/log.lua +++ b/lua/jj/cmd/log.lua @@ -216,7 +216,7 @@ function M.log_keymaps() }, } - return cmd.resolve_keymaps_from_specs(cfg, specs) + return cmd.merge_keymaps(cmd.resolve_keymaps_from_specs(cfg, specs), cmd.close_keymaps()) end return M diff --git a/lua/jj/ui/terminal.lua b/lua/jj/ui/terminal.lua index 04d1792..71a3aad 100644 --- a/lua/jj/ui/terminal.lua +++ b/lua/jj/ui/terminal.lua @@ -293,20 +293,6 @@ function M.run(cmd, keymaps) { modes = { "n", "v" }, lhs = "c", rhs = function() end }, { modes = { "n", "v" }, lhs = "a", rhs = function() end }, { modes = { "n", "v" }, lhs = "u", rhs = function() end }, - -- Close terminal buffer - { - modes = { "n", "v" }, - lhs = "q", - rhs = M.close_terminal_buffer, - opts = { desc = "Close the terminal buffer" }, - }, - -- Close terminal buffer with ESC - { - modes = "n", - lhs = "", - rhs = M.close_terminal_buffer, - opts = { desc = "Close the terminal buffer" }, - }, }) vim.b[state.buf].jj_keymaps_set = true