nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 2b3854787581412e33bafdddbbc3d0a41d79767f
parent 492166a3f710de95cbb285560c5555d631d0ba04
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Wed,  3 May 2017 17:10:46 -0500

display: ensure smooth scrolling when the edit window is resized

When the editing space gets narrower, either by toggling line numbers on
or making nano's window smaller, and when the cursor is near the bottom,
it can be pushed offscreen.  In that case, don't get it back onscreen by
centering the current line but by putting it on the bottom row.  This
makes for a smoother experience.

This fixes http://savannah.gnu.org/bugs/?50933.

Diffstat:
Msrc/winio.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -2959,6 +2959,9 @@ void ensure_firstcolumn_is_aligned(void) #ifndef NANO_TINY if (openfile->firstcolumn % editwincols != 0) openfile->firstcolumn -= (openfile->firstcolumn % editwincols); + + /* If smooth scrolling is on, make sure the viewport doesn't center. */ + focusing = FALSE; #endif }