]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bob detection when pixel scrolling upwards
authorPo Lu <luangruo@yahoo.com>
Fri, 10 Dec 2021 03:30:07 +0000 (11:30 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 10 Dec 2021 03:30:07 +0000 (11:30 +0800)
* lisp/pixel-scroll.el (pixel-point-and-height-at-unseen-line):
Don't go to the beginning-of-visual-line if bobp.

lisp/pixel-scroll.el

index 432a5dc52cff92a0c91fa6e4080ec919a90f9f78..29d8e7e0255cd571a23784d633f0452d980e3020 100644 (file)
@@ -399,7 +399,8 @@ character on the unseen line just above the scope of current
 window, and the pixel height of that line."
   (let* ((pos0 (save-excursion
                  (goto-char (window-start))
-                 (beginning-of-visual-line)
+                 (unless (bobp)
+                   (beginning-of-visual-line))
                  (point)))
          (vscroll0 (window-vscroll nil t))
          (line-height nil)