aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-06-29 12:45:24 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-06-29 12:45:24 +0200
commit409db8ce33eaae2f907e1745519e348e86bcd799 (patch)
tree458944b23992a42c2779fe08cdbc1ff14604434f
parentf199399d2fe8bda40f096d966fe7d03ab96ee00b (diff)
magit-refresh-buffer: Reduce extend of a binding
-rw-r--r--lisp/magit-mode.el32
1 files changed, 16 insertions, 16 deletions
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 0735aef..4c8600d 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1078,27 +1078,27 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
(when (functionp refresh)
(when magit-refresh-verbose
(message "Refreshing buffer `%s'..." (buffer-name)))
+ (deactivate-mark)
+ (setq magit-section-pre-command-section nil)
+ (setq magit-section-highlight-overlays nil)
+ (setq magit-section-selection-overlays nil)
+ (setq magit-section-highlighted-sections nil)
+ (setq magit-section-focused-sections nil)
(let ((positions (magit--refresh-buffer-get-positions)))
- (deactivate-mark)
- (setq magit-section-pre-command-section nil)
- (setq magit-section-highlight-overlays nil)
- (setq magit-section-selection-overlays nil)
- (setq magit-section-highlighted-sections nil)
- (setq magit-section-focused-sections nil)
(let ((inhibit-read-only t))
(erase-buffer)
(save-excursion
(funcall refresh)))
- (magit--refresh-buffer-set-positions positions)
- (when created
- (run-hooks 'magit--initial-section-hook)
- (setq-local magit--initial-section-hook nil))
- (let ((magit-section-cache-visibility nil))
- (magit-section-show magit-root-section))
- (run-hooks 'magit-refresh-buffer-hook)
- (magit-section-update-highlight)
- (set-buffer-modified-p nil)
- (push (current-buffer) magit-section--refreshed-buffers))
+ (magit--refresh-buffer-set-positions positions))
+ (when created
+ (run-hooks 'magit--initial-section-hook)
+ (setq-local magit--initial-section-hook nil))
+ (let ((magit-section-cache-visibility nil))
+ (magit-section-show magit-root-section))
+ (run-hooks 'magit-refresh-buffer-hook)
+ (magit-section-update-highlight)
+ (set-buffer-modified-p nil)
+ (push (current-buffer) magit-section--refreshed-buffers)
(when magit-refresh-verbose
(message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
(float-time (time-since magit--refresh-start-time)))))))