nano

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

commit 5316f5078f373f7e501fbee9221c9ee3c8113da4
parent 286c8778535c2eb47f3a4cfefbb90cc6fbb16b60
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 19 Apr 2019 10:06:57 +0200

tweaks: elide an unneeded variable

After a line break, the preceding line is readily available through
the 'prev' element.

Diffstat:
Msrc/text.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -1434,7 +1434,6 @@ bool do_wrap(void) /* The length of the remainder. */ size_t old_x = openfile->current_x; - linestruct *old_line = openfile->current; /* There are three steps. First, we decide where to wrap. Then, we * create the new wrap line. Finally, we clean up. */ @@ -1537,8 +1536,8 @@ bool do_wrap(void) do_enter(); if (old_x < wrap_loc) { + openfile->current = openfile->current->prev; openfile->current_x = old_x; - openfile->current = old_line; prepend_wrap = TRUE; } else { openfile->current_x += (old_x - wrap_loc);