zk-phi / sublimity

Smooth-scrolling and minimap like sublime editor
492 stars 27 forks source link

Make recentering point at window edge optional #25

Closed michaelbartnett closed 9 years ago

michaelbartnett commented 9 years ago

Sublimity mimics the default Emacs behavior when the point reaches the edge of the window. However, it would be nice to have smooth-scrolling behave exactly like Sublime such that the window only scrolls one line at a time when moving the point outside the window.

This leaves the default behavior, but lets you disable the (recenter) call so that when someone changes Emacs' scrolling behavior (i.e. (setq scroll-conservatively 101) it behaves like you'd expect.

Is this an okay solution?

zk-phi commented 9 years ago

Thanks.

I don't remember well but this line is probably required to calculate new window-start value before redisplay. I tried this solution but sometimes scroll is not animated (after beginning-of-buffer for example).

BTW I use smooth-scrolling for the purpose and it works fine: https://github.com/aspiers/smooth-scrolling.

michaelbartnett commented 9 years ago

Ah, smooth-scrolling works much better. Thanks for for the recommendation!