branch: elpa/magit commit 730add35f75632bb52c1121b732c4356cfd519fe Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-section-update-highlight: Always unhighlight sections Start doing so even after long-lines shortcuts kick in and even if the new current section is the root section. In both cases sections might be highlighted that should no longer be highlighted. --- lisp/magit-section.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/magit-section.el b/lisp/magit-section.el index 890e5486de..d3c808f944 100644 --- a/lisp/magit-section.el +++ b/lisp/magit-section.el @@ -1716,13 +1716,14 @@ evaluated its BODY. Admittedly that's a bit of a hack." (setq magit-section-unhighlight-sections magit-section-highlighted-sections) (setq magit-section-highlighted-sections nil) - (unless (magit-section--maybe-enable-long-lines-shortcuts) - (unless (eq section magit-root-section) - (run-hook-with-args-until-success - 'magit-section-highlight-hook section selection)) - (dolist (s magit-section-unhighlight-sections) - (run-hook-with-args-until-success - 'magit-section-unhighlight-hook s selection))) + (cond ((magit-section--maybe-enable-long-lines-shortcuts)) + ((eq section magit-root-section)) + (t + (run-hook-with-args-until-success + 'magit-section-highlight-hook section selection))) + (dolist (s magit-section-unhighlight-sections) + (run-hook-with-args-until-success + 'magit-section-unhighlight-hook s selection)) (restore-buffer-modified-p nil))) (setq magit-section-highlight-force-update nil) (magit-section-maybe-paint-visibility-ellipses))) @@ -1802,7 +1803,7 @@ Emacs has enabled redisplay shortcuts in this buffer because there are lines whose length go beyond `long-line-threshold' \(%s characters). As a result, section highlighting and the special appearance of the region has been -disabled. Some existing highlighting might remain in effect. +disabled. These shortcuts remain enabled, even once there no longer are any long lines in this buffer. To disable them again, kill