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
master
Benno Schulenberg 2014-06-21 19:40:30 +00:00
parent 76e150b47f
commit fb6c0cd20c
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,8 @@
2014-06-21 Mark Majeres <mark@engine12.com> 2014-06-21 Mark Majeres <mark@engine12.com>
* src/text.c (undo_cut, add_undo): When undoing a cut-till-eof, * 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. 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 <pooka109@gmail.com> 2014-06-21 David Lawrence Ramsey <pooka109@gmail.com>
* src/move.c, src/nano.c: Miscellaneous whitespace fixes, one * src/move.c, src/nano.c: Miscellaneous whitespace fixes, one

View File

@ -518,6 +518,8 @@ void do_undo(void)
filestruct *foo = f->next; filestruct *foo = f->next;
f->data = charealloc(f->data, strlen(f->data) + strlen(&f->next->data[u->mark_begin_x]) + 1); 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]); strcat(f->data, &f->next->data[u->mark_begin_x]);
if (foo == openfile->filebot)
openfile->filebot = f;
unlink_node(foo); unlink_node(foo);
delete_node(foo); delete_node(foo);
} }