nano

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

commit 9bf966af37e3bed7df2b9a26bbd197122c99ad34
parent a76a6bf69232cc08e704c5e64214bf34311233f4
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  8 Dec 2023 16:12:17 +0100

tweaks: add an extra variable, to avoid reusing one for another purpose

Diffstat:
Msrc/winio.c | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -3167,12 +3167,13 @@ size_t get_softwrap_breakpoint(const char *linedata, size_t leftedge, /* If we're softwrapping at blanks and we found at least one blank, break * after that blank -- if it doesn't overshoot the screen's edge. */ if (farthest_blank != NULL) { - size_t onestep = advance_over(farthest_blank, &last_blank_col); + size_t aftertheblank = last_blank_col; + size_t onestep = advance_over(farthest_blank, &aftertheblank); - if (last_blank_col <= goal_column) { + if (aftertheblank <= goal_column) { text = farthest_blank + onestep; - column = last_blank_col; - return last_blank_col; + column = aftertheblank; + return aftertheblank; } /* If it's a tab that overshoots, break at the screen's edge. */