mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-15 23:53:18 +00:00
feat(log): Add change_revset keybind to change the current log revset
being displayed in the log command
This commit is contained in:
@@ -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>",
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user