nano

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

commit e8e9b8ad82822f63b4160b482fa91edaacd058d7
parent 964771afc3b804000ddba3cc3f0fe959b8ad6a2b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 13 May 2020 12:01:55 +0200

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

Diffstat:
Msrc/files.c | 7++-----
Msrc/winio.c | 7+++++--
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -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. */ diff --git a/src/winio.c b/src/winio.c @@ -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;