mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 18:56:13 +00:00
fix(log): Add u/r keymaps for undoing and redoing operations on log buffer.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user