aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2021-12-10 11:25:10 +0800
committerPo Lu2021-12-10 11:25:10 +0800
commit2e4740f04239ee441685b2f43d156efcf6359383 (patch)
treec5419f855c3334f735380cb14a895a518107bd89
parente8d90a3fd402c0c67bf4b4b29ac26108ead8845d (diff)
downloademacs-2e4740f04239ee441685b2f43d156efcf6359383.tar.gz
emacs-2e4740f04239ee441685b2f43d156efcf6359383.zip
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.
-rw-r--r--lisp/pixel-scroll.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 813fbb0711b..432a5dc52cf 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -397,7 +397,10 @@ returns nil."
397The returned value is a cons of the position of the first 397The returned value is a cons of the position of the first
398character on the unseen line just above the scope of current 398character on the unseen line just above the scope of current
399window, and the pixel height of that line." 399window, and the pixel height of that line."
400 (let* ((pos0 (window-start)) 400 (let* ((pos0 (save-excursion
401 (goto-char (window-start))
402 (beginning-of-visual-line)
403 (point)))
401 (vscroll0 (window-vscroll nil t)) 404 (vscroll0 (window-vscroll nil t))
402 (line-height nil) 405 (line-height nil)
403 (pos 406 (pos
@@ -407,8 +410,7 @@ window, and the pixel height of that line."
407 (point-min) 410 (point-min)
408 (vertical-motion -1) 411 (vertical-motion -1)
409 (setq line-height 412 (setq line-height
410 (cdr (window-text-pixel-size nil (point) 413 (cdr (window-text-pixel-size nil (point) pos0)))
411 pos0)))
412 (point))))) 414 (point)))))
413 ;; restore initial position 415 ;; restore initial position
414 (set-window-start nil pos0 t) 416 (set-window-start nil pos0 t)