doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.39k stars 3.05k forks source link

pixel-scroll-precision-mode is jittery with Doom #6977

Open NightMachinery opened 1 year ago

NightMachinery commented 1 year ago

I confirm that...

Expected behavior

The new pixel-scroll-precision-mode works well with emacs -q, but when I run it with only Doom (and not my personal config), it becomes jittery. The jitter happens when the cursor is at the bottom of the screen and one scrolls up. The cursor wants to stay at a whole line, while the pixel scrolling scrolls at fractions of a line. In emacs -q, this doesn't cause problems and it will scroll more to make it a whole line. In Doom, there is jitter and sometimes it scrolls back DOWN to make it a whole line.

I tested this on the file ~/.emacs.d/lisp/lib/ui.el.

PS: To make Doom not load my config, I manually added a check for DOOMDIR and stopped loading my config if it didn't exist. This still loads config.el, where I have set a few variables. I think the installed packages might have also been loaded. I don't know how to load Doom without these. I used DOOMDIR=~/doesnotexist, but it didn't seem to affect anything. It still loaded ~/doom.d.

Current behavior

_

Steps to reproduce

_

System Information

https://pastebin.com/U7EZhSHC

ymarco commented 1 year ago

Which Emacs commit are you on? When I ran master a few months ago it worked great, even with scroll-margin set to 7.

NightMachinery commented 1 year ago

Which Emacs commit are you on? When I ran master a few months ago it worked great, even with scroll-margin set to 7.

I am on ca42ff5f0ee757f0a70f603863c83e85eef683b9. Indeed, using (setq scroll-margin 7) mostly solves the issue, but in emacs -q, things work fine with (setq scroll-margin 0).

PS: In org-mode with inline images, scroll-margin really needs to be zero, or the scrolling will become very bad on small laptop screens.

aikrahguzar commented 1 year ago

I had the same issue and I noticed that it didn't happen if I was scrolling a new window which was no selected. So, it was somehow related to the cursor. It also didn't happen with emacs -Q. So while trying to figure out what was causing the issue I decided to see if evil was responsible somehow: so I did M-x evil-local-mode to turn off evil and the issue disappeared again. This led me to evil-adjust-cursor and I looking at the code I could see I can get rid of it by setting evil-move-beyond-eol to t so I tried that and scrolling again became smooth,

I have actually wanted the behavior of evil-move-beyond-eol to I will stick with this "fix".