Commit 2b385478 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 3 additions and 0 deletions
+3 -0
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment