Skip to content

Commit b51b658

Browse files
committed
Convert redo popup
1 parent 7767894 commit b51b658

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

magit-stgit.el

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ one from the minibuffer, and move to the next line."
264264
("r" "Repair" magit-stgit-repair)
265265
("R" "Rebase" magit-stgit-rebase)]
266266
[("z" "Undo" magit-stgit-undo)
267-
("Z" "Redo" magit-stgit-redo-popup)]]
267+
("Z" "Redo" magit-stgit-redo)]]
268268
["Patch"
269269
[("N" "New" magit-stgit-new)
270270
("g" "Refresh" magit-stgit-refresh)
@@ -576,19 +576,21 @@ ask for confirmation before deleting."
576576
(interactive (transient-args 'magit-stgit-undo))
577577
(magit-run-stgit "undo" args))
578578

579-
(magit-define-popup magit-stgit-redo-popup
580-
"Popup console for StGit redo."
581-
'magit-stgit-commands
582-
:options '((?n "Undo the last N commands" "--number=" read-number))
583-
:switches '((?h "Discard changes in index/worktree" "--hard"))
584-
:actions '((?Z "Redo" magit-stgit-redo))
585-
:default-action #'magit-stgit-redo)
579+
(transient-define-prefix magit-stgit-redo ()
580+
"Undo a previous undo operation."
581+
:man-page "stg-redo"
582+
["Arguments"
583+
("-n" "Undo the last N undos" "--number="
584+
:reader (lambda (prompt _initial-input history)
585+
(number-to-string (read-number prompt nil history))))
586+
("-h" "Discard changes in index/worktree" "--hard")]
587+
["Actions"
588+
("Z" "Redo" magit-stgit--redo)])
586589

587590
;;;###autoload
588-
(defun magit-stgit-redo (&rest args)
589-
"Undo the last undo operation.
590-
Use ARGS to pass additional arguments."
591-
(interactive (magit-stgit-redo-arguments))
591+
(defun magit-stgit--redo (&rest args)
592+
"Invoke `stg redo ARGS...'."
593+
(interactive (transient-args 'magit-stgit-redo))
592594
(magit-run-stgit "redo" args))
593595

594596
;;;; magit-stgit-mail
@@ -716,8 +718,8 @@ the To, Cc, and Bcc fields for all patches."
716718
"---"
717719
["Undo stack operation" magit-stgit-undo
718720
:help "Undo a previous stack operation"]
719-
["Undo the last undo operation" magit-stgit-redo-popup
720-
:help "Undo the last undo operation"]))
721+
["Redo stack operation" magit-stgit-redo
722+
:help "Undo a previous undo operation"]))
721723

722724
(easy-menu-add-item 'magit-mode-menu '("Extensions") magit-stgit-mode-menu)
723725

0 commit comments

Comments
 (0)