io12/good-scroll.el

Can't scroll down when cursor position is on the first line of a file/buffer

ianyepan opened this issue · 6 comments

As titled: When the cursor is placed on the first line of the file and the user wishes to scroll down, the frame appears to be stuck and struggles to scroll more than a few pixels.

This happens sometimes too when the cursor is positioned on the first line of the "visible frame" (not necessarily the first line of the file).

#6 and #7 are possibly related issues, but I'm not quite sure.

On further investigation, it seems to be related to the length of the buffer content too. Specifically, this issue almost never appears when the buffer content is less than one page long (when the content does not reach the end of the visible frame).

io12 commented

I think this issue and #6, #7 are all because the code to move the cursor away from the edge of the window isn't great. Emacs seems to really not like the cursor being outside the window. I will try again to look into fixing this.

I see I see, thanks for getting back.

io12 commented

A fix for this is mostly finished in the move-point-fixes branch. I just need to handle a few more edge cases, add more comments, debug performance, etc.

io12 commented

The fix had a performance issue because apparently pos-visible-in-window-p is slow, but I worked around that by caching the result and updating it. This will probably be released within the next few days.

io12 commented

Fixed in 2ca5a5e