mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fix jumping cursor during interpolated scrolls
* lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page): Go to next position before setting start or vscroll.
This commit is contained in:
parent
bb1252bdb3
commit
52f3fe46a3
1 changed files with 9 additions and 9 deletions
|
|
@ -459,6 +459,14 @@ the height of the current window."
|
|||
(set-window-vscroll nil (+ (window-vscroll nil t)
|
||||
delta)
|
||||
t)
|
||||
(when (and (or (< (point) next-pos))
|
||||
(let ((pos-visibility (pos-visible-in-window-p next-pos nil t)))
|
||||
(and pos-visibility
|
||||
(or (eq (length pos-visibility) 2)
|
||||
(when-let* ((posn (posn-at-point next-pos)))
|
||||
(> (cdr (posn-object-width-height posn))
|
||||
usable-height))))))
|
||||
(goto-char next-pos))
|
||||
(set-window-start nil (if (zerop (window-hscroll))
|
||||
desired-start
|
||||
(save-excursion
|
||||
|
|
@ -466,15 +474,7 @@ the height of the current window."
|
|||
(beginning-of-visual-line)
|
||||
(point)))
|
||||
t)
|
||||
(set-window-vscroll nil desired-vscroll t))
|
||||
(if (and (or (< (point) next-pos))
|
||||
(let ((pos-visibility (pos-visible-in-window-p next-pos nil t)))
|
||||
(and pos-visibility
|
||||
(or (eq (length pos-visibility) 2)
|
||||
(when-let* ((posn (posn-at-point next-pos)))
|
||||
(> (cdr (posn-object-width-height posn))
|
||||
usable-height))))))
|
||||
(goto-char next-pos))))
|
||||
(set-window-vscroll nil desired-vscroll t))))
|
||||
|
||||
(defun pixel-scroll-precision-scroll-down (delta)
|
||||
"Scroll the current window down by DELTA pixels."
|
||||
|
|
|
|||
Loading…
Reference in a new issue