branch: elpa/magit
commit de65fffecac263922d8c9b2812861195f82ea5fd
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-diff-inside-hunk-body-p: Cosmetics
---
lisp/magit-diff.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index df8028a369e..f369d462f38 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3611,10 +3611,11 @@ last (visual) lines of the region."
;;; Utilities
(defun magit-diff-inside-hunk-body-p ()
- "Return non-nil if point is inside the body of a hunk."
- (and (magit-section-match 'hunk)
- (and-let* ((content (oref (magit-current-section) content)))
- (> (magit-point) content))))
+ "Return t if point is inside the body of a hunk."
+ (and-let* ((section (magit-current-section))
+ ((cl-typep section 'magit-hunk-section))
+ (content (oref section content)))
+ (> (magit-point) content)))
(defun magit-diff-on-removed-line-p ()
"Return t if point is on a removed line inside the body of a hunk."