From 861eee42418f510679a6e3ae1ee433353194cb68 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 15 Dec 2021 10:27:27 +0800 Subject: [PATCH] Work around pixel scrolling issues when line numbers are displayed * lisp/pixel-scroll.el (pixel-point-and-height-at-unseen-line): Compare start position against line number display width instead. --- lisp/pixel-scroll.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 142ebf9c65a..fa0185b16e9 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -417,7 +417,8 @@ window, and the pixel height of that line." (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)) + (> (car (posn-x-y (posn-at-point pos0))) + (line-number-display-width t))) (setq line-height (- line-height (save-excursion (goto-char pos0) -- 2.39.5