fix(log): Add u/r keymaps for undoing and redoing operations on log buffer.

This commit is contained in:
NicolasGB
2025-11-18 14:33:16 +01:00
parent 10c9a07ad7
commit 84ba77a8fc
2 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -50,9 +50,16 @@ In your log ouptut press `CR` in a line to directly edit a `mutable` change.
You can create new changes directly from the log buffer with multiple options:
- `n` - Create a new change branching off the revision under the cursor
- `<C-n>` - Create a new change after the revision under the cursor
- `<C-n>` - Create a new change after the revision under the cursor
- `<S-n>` - Create a new change after while ignoring immutability constraints
### Undo/Redo from the log buffer
You can undo/redo changes directly from the log buffer:
- `u` - Undo the last operation
- `r` - Redo the last undone operation
### Open a changed file
Just press enter to open the a file from the `status` output in your current window.
+7 -1
View File
@@ -590,6 +590,13 @@ local function run(cmd)
register_command_keymap({ "n" }, "<S-n>", function()
handle_log_new("after", true)
end, { desc = "New change after the change under cursor ignoring immutability" })
-- Undo/Redo
register_command_keymap({ "n" }, "u", function()
M.undo()
end, { desc = "Undo last operation" })
register_command_keymap({ "n" }, "r", function()
M.redo()
end, { desc = "Redo last operation" })
end
if #new_command_keymaps > 0 then
@@ -1132,4 +1139,3 @@ function M.register_command()
end
return M