mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
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.
This commit is contained in:
parent
492166a3f7
commit
2b38547875
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user