branch: elpa/magit commit 8005019185b1333699423d713b4fd87fc87a2b94 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit--refresh-buffer-set-positions: Don't restore window-start in logs --- CHANGELOG | 10 ++++++++++ lisp/magit-mode.el | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2db65a2e0e..286bfcf9aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,14 @@ # -*- mode: org -*- +* v4.3.8 UNRELEASED + +Bugfixes: + +- In v4.3.7 we started to restore the display-start positions of the + windows displaying a buffer that is being refreshed, but in log + buffers that is undesirable. After creating a new commit we want + that to immediately be displayed at the top of windows displaying + log buffers. #5403 + * v4.3.7 2025-07-01 - Refreshing a buffer causes its content to be recreated, which can diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index ddca229bad..a90b1dabe1 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -1141,7 +1141,8 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (> window-start (point)))) ((magit-section-equal ws-section (magit-section-at window-start)) (set-window-start window window-start t)) - ((when-let ((pos (save-excursion + ((not (derived-mode-p 'magit-log-mode)) + (when-let ((pos (save-excursion (and (magit-section-goto-successor--same ws-section ws-line 0) (point)))))