feat(duplicate): Add a duplication mode (#118)

This commit is contained in:
Nicolas GB
2026-06-08 09:09:28 +02:00
committed by GitHub
parent 8696843752
commit 33179e2f15
3 changed files with 194 additions and 6 deletions
+21
View File
@@ -58,6 +58,8 @@ local split_module = require("jj.cmd.split")
--- @field tag_set? string|string[]
--- @field history? string|string[]
--- @field change_revset? string|string[]
--- @field duplicate? string|string[]
--- @field duplicate_mode? jj.cmd.duplicate.keymaps
--- @class jj.cmd.rebase.keymaps
--- @field onto? string|string[]
@@ -68,6 +70,15 @@ local split_module = require("jj.cmd.split")
--- @field before_immutable? string|string[]
--- @field exit_mode? string|string[]
--- @class jj.cmd.duplicate.keymaps
--- @field onto? string|string[]
--- @field after? string|string[]
--- @field before? string|string[]
--- @field onto_immutable? string|string[]
--- @field after_immutable? string|string[]
--- @field before_immutable? string|string[]
--- @field exit_mode? string|string[]
--- @class jj.cmd.squash.keymaps
--- @field into? string|string[]
--- @field into_immutable? string|string[]
@@ -183,6 +194,16 @@ M.config = {
into_immutable = "<S-CR>",
exit_mode = { "<Esc>", "<C-c>" },
},
duplicate = "<C-y>",
duplicate_mode = {
onto = { "<CR>", "o" },
after = "a",
before = "b",
onto_immutable = { "<S-CR>", "<S-o>" },
after_immutable = "<S-a>",
before_immutable = "<S-b>",
exit_mode = { "<Esc>", "<C-c>" },
},
quick_squash = "<S-s>",
summary = "<S-k>",
summary_tooltip = {