nano

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

commit 8b2b9654ab8d3634b23362ad1234ddfdea295085
parent 60ae71bf3a4528362a3f78b99cfa74dac4181e18
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 18 Feb 2020 16:23:43 +0100

tweaks: condense a comment, reshuffle conditions, and remove unwanted one

Diffstat:
Msrc/nano.c | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1707,14 +1707,12 @@ void inject(char *burst, size_t count) #endif #ifndef NANO_TINY - /* If the number of screen rows that a softwrapped line occupies has - * changed, we need a full refresh. And if we were on the last line - * of the edit window, and we moved one screen row, we're now below - * the last line of the edit window, so we need a full refresh too. */ - if (ISSET(SOFTWRAP) && refresh_needed == FALSE && - (number_of_chunks_in(openfile->current) != old_amount || - (openfile->current_y == editwinrows - 1 && - chunk_for(xplustabs(), openfile->current) > original_row))) { + /* If we were on the last row of the edit window and moved to a new chunk, + * or if the number of chunks that the current softwrapped line occupies + * changed, we need a full refresh. */ + if (ISSET(SOFTWRAP) && ((openfile->current_y == editwinrows - 1 && + chunk_for(xplustabs(), openfile->current) > original_row) || + number_of_chunks_in(openfile->current) != old_amount)) { refresh_needed = TRUE; focusing = FALSE; }