branch: elpa/magit commit 7a4b665f25f0430cccafee5c1f9f960fa0869596 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-jump-to-diffstat-or-diff: Move definition --- lisp/magit-diff.el | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 5004502972..4485cc8d03 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -1885,6 +1885,23 @@ the Magit-Status buffer for DIRECTORY." (throw 'found nil)))))) (+ line offset))) +;;;;; Movement + +(defun magit-jump-to-diffstat-or-diff () + "Jump to the diffstat or diff. +When point is on a file inside the diffstat section, then jump +to the respective diff section, otherwise jump to the diffstat +section or a child thereof." + (interactive) + (if-let ((section (magit-get-section + (append (magit-section-case + ([file diffstat] `((file . ,(oref it value)))) + (file `((file . ,(oref it value)) (diffstat))) + (t '((diffstat)))) + (magit-section-ident magit-root-section))))) + (magit-section-goto section) + (user-error "No diffstat in this buffer"))) + ;;;; Scroll Commands (defun magit-diff-show-or-scroll-up () @@ -2253,21 +2270,6 @@ keymap is the parent of their keymaps." (magit-wash-sequence (##magit-diff-wash-diff args)) (insert ?\n))) -(defun magit-jump-to-diffstat-or-diff () - "Jump to the diffstat or diff. -When point is on a file inside the diffstat section, then jump -to the respective diff section, otherwise jump to the diffstat -section or a child thereof." - (interactive) - (if-let ((section (magit-get-section - (append (magit-section-case - ([file diffstat] `((file . ,(oref it value)))) - (file `((file . ,(oref it value)) (diffstat))) - (t '((diffstat)))) - (magit-section-ident magit-root-section))))) - (magit-section-goto section) - (user-error "No diffstat in this buffer"))) - (defun magit-diff-wash-signature (object) (cond ((looking-at "^No signature")