]> git.eshelyaron.com Git - emacs.git/commitdiff
Work around pixel scrolling issues when org-indent-mode is on
authorPo Lu <luangruo@yahoo.com>
Mon, 13 Dec 2021 01:59:39 +0000 (09:59 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 13 Dec 2021 01:59:39 +0000 (09:59 +0800)
* lisp/pixel-scroll.el (pixel-point-and-height-at-unseen-line):
Subtract line height of window start when it doesn't appear
at the 0th pixel of the line.

lisp/pixel-scroll.el

index 0e22ef2a6a70827e94c153aecaad193f3965fdb7..142ebf9c65ab9dfcdc202f96e6202f7b5d5fe4db 100644 (file)
@@ -416,6 +416,12 @@ window, and the pixel height of that line."
     ;; restore initial position
     (set-window-start nil pos0 t)
     (set-window-vscroll nil vscroll0 t)
+    (when (and line-height
+               (> (car (posn-x-y (posn-at-point pos0))) 0))
+      (setq line-height (- line-height
+                           (save-excursion
+                             (goto-char pos0)
+                             (line-pixel-height)))))
     (cons pos line-height)))
 
 (defun pixel-point-at-unseen-line ()