branch: elpa/magit
commit 925762e957c31e8bdf9e5630d2d99e98e4dc3abe
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-section-update-paint: Register already painted expanded hunk
When we navigate to a collapsed hunk, whose body is secretly already
highlighted and expand it, we can (and already do) avoid painting it
again. However, we failed to register it as painted again, which is
necessary to cause it to be unhighlighted once we move away from it,
regardless of how far back the painting as highlighted occurred.
We do not just leave the section registered as painted, after collapsing
it and then moving away, because `magit-section-update-highlight' would
then have to consider its state after every command.
Closes #5393.
Suggested-by: Eliza Velasquez
---
lisp/magit-section.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 3f1e387d3d5..5eac6753a9e 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -1829,6 +1829,8 @@ evaluated its BODY. Admittedly that's a bit of a hack."
(`(focus ,(or 'nil 'plain))
(paint t)
(cl-pushnew section magit-section-highlighted-sections))
+ (`(focus highlight)
+ (cl-pushnew section magit-section-highlighted-sections))
(`(unfocus ,(or 'nil 'highlight))
(paint nil)
(unregister))