tweaks: move an 'if', to not call leftedge_for() when not softwrapping

master
Benno Schulenberg 2020-05-13 12:01:55 +02:00
parent 964771afc3
commit e8e9b8ad82
2 changed files with 7 additions and 7 deletions

View File

@ -535,12 +535,9 @@ void redecorate_after_switch(void)
#ifndef NANO_TINY
/* While in a different buffer, the screen may have been resized
* or softwrap mode maybe have been toggled, so make sure that the
* or softwrap mode may have been toggled, so make sure that the
* starting column for the first row gets an appropriate value. */
if (ISSET(SOFTWRAP))
ensure_firstcolumn_is_aligned();
else
openfile->firstcolumn = 0;
ensure_firstcolumn_is_aligned();
#endif
/* Update title bar and multiline info to match the current buffer. */

View File

@ -3130,8 +3130,11 @@ size_t number_of_chunks_in(linestruct *line)
* has changed, because then the width of softwrapped chunks has changed. */
void ensure_firstcolumn_is_aligned(void)
{
openfile->firstcolumn = leftedge_for(openfile->firstcolumn,
openfile->edittop);
if (ISSET(SOFTWRAP))
openfile->firstcolumn = leftedge_for(openfile->firstcolumn,
openfile->edittop);
else
openfile->firstcolumn = 0;
/* If smooth scrolling is on, make sure the viewport doesn't center. */
focusing = FALSE;