feat(log): Add change_revset keybind to change the current log revset

being displayed in the log command
This commit is contained in:
NicolasGB
2026-03-12 18:04:39 +01:00
parent 80caa923c2
commit d357409268
3 changed files with 27 additions and 1 deletions
+2
View File
@@ -56,6 +56,7 @@ local split_module = require("jj.cmd.split")
--- @field summary_tooltip? jj.cmd.summary_tooltip.keymaps
--- @field tag_set? string|string[]
--- @field history? string|string[]
--- @field change_revset? string|string[]
--- @class jj.cmd.rebase.keymaps
--- @field onto? string|string[]
@@ -199,6 +200,7 @@ M.config = {
split = "<C-s>",
tag_set = "<S-t>",
history = "<S-h>",
change_revset = "<C-r>",
},
status = {
open_file = "<CR>",
+14
View File
@@ -692,6 +692,15 @@ function M.handle_log_tag_set(revset)
require("jj.cmd").tag_set(revset)
end
--- Handle log change revset
function M.handle_log_change_revset()
vim.ui.input({ prompt = "Enter new revset: " }, function(input)
if input and input ~= "" then
M.log({ revisions = input })
end
end)
end
--- Handle opening a PR/MR from `jj log` buffer for the revision under cursor
--- @param list_bookmarks? boolean If true, prompt to select from all bookmarks instead of using current revision
function M.handle_log_open_pr(list_bookmarks)
@@ -1153,6 +1162,11 @@ function M.log_keymaps()
handler = M.handle_log_history,
modes = { "v" },
},
change_revset = {
desc = "Change the revset(s) being viewed",
handler = M.handle_log_change_revset,
modes = { "n", "v" },
},
}
local merged_keymaps = cmd.merge_keymaps(cmd.resolve_keymaps_from_specs(keymaps, specs), cmd.terminal_keymaps())