diff --git a/src/winio.c b/src/winio.c index 88ce698f..21922a28 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3387,6 +3387,10 @@ void edit_refresh(void) linestruct *line; int row = 0; + /* If the current line is out of view, get it back on screen. */ + if (current_is_offscreen()) + adjust_viewport((focusing || ISSET(JUMPY_SCROLLING)) ? CENTERING : FLOWING); + #ifdef ENABLE_COLOR /* When needed and useful, initialize the colors for the current syntax. */ if (openfile->syntax && !have_palette && !ISSET(NO_SYNTAX) && has_colors()) @@ -3399,10 +3403,6 @@ void edit_refresh(void) } #endif - /* If the current line is out of view, get it back on screen. */ - if (current_is_offscreen()) - adjust_viewport((focusing || ISSET(JUMPY_SCROLLING)) ? CENTERING : FLOWING); - #ifndef NANO_TINY if (thebar) draw_scrollbar();