[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 2e4740f: Fix pixel scrolling upwards in Info buffers
From: |
Po Lu |
Subject: |
master 2e4740f: Fix pixel scrolling upwards in Info buffers |
Date: |
Thu, 9 Dec 2021 22:25:56 -0500 (EST) |
branch: master
commit 2e4740f04239ee441685b2f43d156efcf6359383
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix pixel scrolling upwards in Info buffers
* lisp/pixel-scroll.el (pixel-point-and-height-at-unseen-line):
Don't blindly trust window start to be the beginning of a
visual line.
---
lisp/pixel-scroll.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 813fbb0..432a5dc 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -397,7 +397,10 @@ returns nil."
The returned value is a cons of the position of the first
character on the unseen line just above the scope of current
window, and the pixel height of that line."
- (let* ((pos0 (window-start))
+ (let* ((pos0 (save-excursion
+ (goto-char (window-start))
+ (beginning-of-visual-line)
+ (point)))
(vscroll0 (window-vscroll nil t))
(line-height nil)
(pos
@@ -407,8 +410,7 @@ window, and the pixel height of that line."
(point-min)
(vertical-motion -1)
(setq line-height
- (cdr (window-text-pixel-size nil (point)
- pos0)))
+ (cdr (window-text-pixel-size nil (point) pos0)))
(point)))))
;; restore initial position
(set-window-start nil pos0 t)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 2e4740f: Fix pixel scrolling upwards in Info buffers,
Po Lu <=