summaryrefslogtreecommitdiff
path: root/lisp/pixel-scroll.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-12-13 09:59:39 +0800
committerPo Lu <luangruo@yahoo.com>2021-12-13 09:59:39 +0800
commit2f6601054940e698184f4c9c60a47c16e5baa880 (patch)
tree68e43e6dea0cbb071bfd3f3619afbe17497e9d20 /lisp/pixel-scroll.el
parent5181276b4362b25cd91818bc0b4e6fbd985b5882 (diff)
downloademacs-2f6601054940e698184f4c9c60a47c16e5baa880.tar.gz
Work around pixel scrolling issues when org-indent-mode is on
* 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.
Diffstat (limited to 'lisp/pixel-scroll.el')
-rw-r--r--lisp/pixel-scroll.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el
index 0e22ef2a6a7..142ebf9c65a 100644
--- a/lisp/pixel-scroll.el
+++ b/lisp/pixel-scroll.el
@@ -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 ()