[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/magit e254dda362 07/28: magit-diff-highlight-list: Fix cas
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/magit e254dda362 07/28: magit-diff-highlight-list: Fix case when showing an error |
Date: |
Fri, 6 Dec 2024 17:17:03 -0500 (EST) |
branch: elpa/magit
commit e254dda362865945b19facc2a452e9c802b3213b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-diff-highlight-list: Fix case when showing an error
Usually each child has to be highlighted individually. When we are
displaying an error instead, then there are no children and we have
to fall back to regular highlighting.
---
lisp/magit-diff.el | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 224a28d25a..e8214eef84 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -3197,24 +3197,26 @@ are highlighted."
(_ (magit-section-highlight section nil))))
(defun magit-diff-highlight-list (section &optional selection)
- (let ((beg (oref section start))
- (cnt (oref section content))
- (end (oref section end)))
- (when (or (eq this-command #'mouse-drag-region)
- (not selection))
- (unless (and (region-active-p)
- (<= (region-beginning) beg))
- (magit-section-make-overlay beg cnt 'magit-section-highlight))
- (if (oref section hidden)
- (oset section washer #'ignore)
- (dolist (child (oref section children))
- (when (or (eq this-command #'mouse-drag-region)
- (not (and (region-active-p)
- (<= (region-beginning)
- (oref child start)))))
- (magit-diff-highlight-recursive child selection)))))
- (when magit-diff-highlight-hunk-body
- (magit-section-make-overlay (1- end) end 'magit-section-highlight))))
+ (if (oref section children)
+ (let ((beg (oref section start))
+ (cnt (oref section content))
+ (end (oref section end)))
+ (when (or (eq this-command #'mouse-drag-region)
+ (not selection))
+ (unless (and (region-active-p)
+ (<= (region-beginning) beg))
+ (magit-section-make-overlay beg cnt 'magit-section-highlight))
+ (if (oref section hidden)
+ (oset section washer #'ignore)
+ (dolist (child (oref section children))
+ (when (or (eq this-command #'mouse-drag-region)
+ (not (and (region-active-p)
+ (<= (region-beginning)
+ (oref child start)))))
+ (magit-diff-highlight-recursive child selection)))))
+ (when magit-diff-highlight-hunk-body
+ (magit-section-make-overlay (1- end) end 'magit-section-highlight)))
+ (magit-section-highlight section nil)))
(defun magit-diff-highlight-file (section &optional selection)
(magit-diff-highlight-heading section selection)
- [nongnu] elpa/magit updated (4992c3d1f6 -> 7adad8c8d3), Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 047ad22a37 01/28: make: Undeprecate if-let and when-let, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit f5f26b449d 05/28: magit--git-wash: Insert empty line after error message, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 15bf7dc53d 09/28: magit--insert-log: Ignore magit--git-wash-keep-error again, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 1f17e515cf 06/28: magit--git-{insert, wash}: Potentially use complete error text, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 230b91d819 04/28: magit--insert-{diff, log}: Respect magit--git-wash-keep-error, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit b2b07b993e 02/28: Silence checkdoc, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit e254dda362 07/28: magit-diff-highlight-list: Fix case when showing an error,
Jonas Bernoulli <=
- [nongnu] elpa/magit 76253bda0d 08/28: magit--git-wash-keep-error: Enable by default, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 8a6ca692fe 14/28: magit-process-password-prompt-regexps: Add another user@host lookup, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 7adad8c8d3 28/28: Release version 4.1.3, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit cea06e4d4e 27/28: Bump dependencies, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit e52dedf07f 22/28: magit-stash-{pop, apply}: Stop after successfully installing conflict, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 8cee789f7a 10/28: magit-anything-staged-p: Extend comment about Git v2.46.{0, 1} bugs, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 70aa9eeee0 20/28: Update changelog, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit a98ebd273f 13/28: magit-process-password-auth-source: Trim docstring, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 46824fb4c1 24/28: Fix typos in changelog, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 089f130f73 11/28: ci: Generate statistics weekly, Jonas Bernoulli, 2024/12/06