Allow unmarking the marked commit.

Once, I hit "." instead of "r ." by accident and have found no way to
reset this mark. This just seems not to be right.
This commit is contained in:
Alexey Voinov 2009-01-22 00:45:41 +02:00 committed by Marius Vollmer
parent 76406385a2
commit c691bc7800
2 changed files with 16 additions and 9 deletions

View file

@ -2359,11 +2359,15 @@ Prefix arg means justify as well."
((commit) ((commit)
(magit-show-commit info #'scroll-down)))) (magit-show-commit info #'scroll-down))))
(defun magit-mark-item () (defun magit-mark-item (&optional unmark)
(interactive) (interactive "P")
(magit-section-action (item info "mark") (if unmark
((commit) (magit-set-marked-commit nil)
(magit-set-marked-commit info)))) (magit-section-action (item info "mark")
((commit)
(magit-set-marked-commit (if (eq magit-marked-commit info)
nil
info))))))
(defun magit-describe-item () (defun magit-describe-item ()
(interactive) (interactive)

View file

@ -253,10 +253,13 @@ kill ring.
Typing @kbd{=} will show the differences from the current commit to Typing @kbd{=} will show the differences from the current commit to
the @dfn{marked} commit. the @dfn{marked} commit.
You can mark the current commit by typing @kbd{.}. Some commands, You can mark the current commit by typing @kbd{.}. When the current
such as @kbd{=}, will use the current commit and the marked commit as commit is already marked, typing @kbd{.} will unmark it. To unmark
implicit arguments. Other commands will offer the marked commit as a the marked commit no matter where point it, use @kbd{C-u .}.
default when prompting for their arguments.
Some commands, such as @kbd{=}, will use the current commit and the
marked commit as implicit arguments. Other commands will offer the
marked commit as a default when prompting for their arguments.
@node Reflogs @node Reflogs
@chapter Reflogs @chapter Reflogs