nano

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

commit b5f320a2f94550a189f11e3a83bdd464f34e0277
parent 7568bd9af5529a316a6b856f64f521832eaed9df
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 11 Aug 2024 07:28:04 +0200

tweaks: delete three redundant checks from the undo/redo code

Since commit 50954a4b from two years ago, a replacing session will
not ever change the final empty line, and thus a fresh magic line
will never need to be undone or redone.

This complements commit c6a26641 from five months ago.

Diffstat:
Msrc/text.c | 6------
1 file changed, 0 insertions(+), 6 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -572,8 +572,6 @@ void do_undo(void) break; case REPLACE: undidmsg = _("replacement"); - if ((u->xflags & INCLUDED_LAST_LINE) && !ISSET(NO_NEWLINES)) - remove_magicline(); data = u->strdata; u->strdata = line->data; line->data = data; @@ -751,8 +749,6 @@ void do_redo(void) break; case REPLACE: redidmsg = _("replacement"); - if ((u->xflags & INCLUDED_LAST_LINE) && !ISSET(NO_NEWLINES)) - new_magicline(); data = u->strdata; u->strdata = line->data; line->data = data; @@ -1037,8 +1033,6 @@ void add_undo(undo_type action, const char *message) break; case REPLACE: u->strdata = copy_of(thisline->data); - if (thisline == openfile->filebot && answer[0] != '\0') - u->xflags |= INCLUDED_LAST_LINE; break; #ifdef ENABLE_WRAPPING case SPLIT_BEGIN: