[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 99f45ee: In follow mode, prevent the cursor resti
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] emacs-26 99f45ee: In follow mode, prevent the cursor resting on a partially displayed line |
Date: |
Wed, 3 Oct 2018 12:07:48 -0400 (EDT) |
branch: emacs-26
commit 99f45ee42c5554d606407f6da37700e9bf86bd35
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
In follow mode, prevent the cursor resting on a partially displayed line
Don't merge to master. This fixes bug #32848
* lisp/follow.el (follow-adjust-window): If point ends up in a partially
displayed line in a left hand or middle window, move it one line
forward, to
prevent unwanted scrolling should make-cursor-line-fully-visible be
non-nil.
---
lisp/follow.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lisp/follow.el b/lisp/follow.el
index fd397c0..eb48ec1 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -1385,7 +1385,13 @@ non-first windows in Follow mode."
(unless (eq win (selected-window))
(let ((p (window-point win)))
(set-window-start win (window-start win) nil)
- (set-window-point win p))))
+ (if (nth 2 (pos-visible-in-window-p p win t))
+ ;; p is in a partially visible line. We can't leave
+ ;; window-point there, because C-x o back into WIN
+ ;; would then fail.
+ (with-selected-window win
+ (forward-line)) ; redisplay will recenter it in WIN.
+ (set-window-point win p)))))
(unless visible
;; If point may not be visible in the selected window,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 99f45ee: In follow mode, prevent the cursor resting on a partially displayed line,
Alan Mackenzie <=