Skip to content

Commit

Permalink
Fix pixel-scroll-precision-mode when point is on a blank line
Browse files Browse the repository at this point in the history
When in the point is on a blank line in normal state, scrolling down
with `pixel-scroll-precision-mode` enabled "sticks" because Evil ends up
invoking `line-move` in the `post-command-hook`. `line-move` resets
vscroll to 0, which undoes the scroll if we scrolled less than a line.

Specifically, `evil-normal-post-command` calls `evil-adjust-cursor`
which calls `evil-move-end-of-line` which calls `move-end-of-line`,
which finally calls `line-move`.

This change avoids this issue by removing the call to `evil-move-end-of-line`
entirely, instead relying on the `bolp` call in `evil-move-cursor-back`.
  • Loading branch information
Stebalien authored and axelf4 committed Aug 10, 2024
1 parent 30ebe6d commit 5db0bdc
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,6 @@ Like `move-end-of-line', but retains the goal column."
This behavior is controlled by `evil-move-beyond-eol'."
(and (not evil-move-beyond-eol)
(eolp)
(= (point) (save-excursion (evil-move-end-of-line) (point)))
(evil-move-cursor-back t)))

(defun evil-move-cursor-back (&optional force)
Expand Down

0 comments on commit 5db0bdc

Please sign in to comment.