From fb6c0cd20ccc161ce7c1cb3ece80f11795332ddc Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 21 Jun 2014 19:40:30 +0000 Subject: [PATCH] When undoing a line break at the tail of the file, make sure openfile->filebot is updated. Patch by Mark Majeres. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5006 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/text.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index b7e0b346..362c7c52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2014-06-21 Mark Majeres * src/text.c (undo_cut, add_undo): When undoing a cut-till-eof, put the cursor back where the cut started, and not at the end. + * src/text.c (do_undo): When undoing a line break at the tail + of the file, make sure openfile->filebot is updated. 2014-06-21 David Lawrence Ramsey * src/move.c, src/nano.c: Miscellaneous whitespace fixes, one diff --git a/src/text.c b/src/text.c index 8138d20a..da4da3e1 100644 --- a/src/text.c +++ b/src/text.c @@ -518,6 +518,8 @@ void do_undo(void) filestruct *foo = f->next; f->data = charealloc(f->data, strlen(f->data) + strlen(&f->next->data[u->mark_begin_x]) + 1); strcat(f->data, &f->next->data[u->mark_begin_x]); + if (foo == openfile->filebot) + openfile->filebot = f; unlink_node(foo); delete_node(foo); } -- 2.39.5