diff --git a/ChangeLog b/ChangeLog index 4377641116c26becae3d2161c83215b539d3cc27..4d847df16c0d154f5de389e73570b005f247faa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-26 Benno Schulenberg <bensberg@justemail.net> + * src/text.c (do_redo): Not just the undoing, also the redoing of a + Backspace at EOF is a special case. This fixes Savannah bug #46532. + 2015-11-25 Benno Schulenberg <bensberg@justemail.net> * src/nano.c (do_output): Refreshing the whole edit window (instead of just the current line) is not needed for any kind of syntax, but diff --git a/src/text.c b/src/text.c index 3e6e75cfaeffe85a8a081126e2fd05d88b30da78..20c98287645886ec40367581603f5700e337a935 100644 --- a/src/text.c +++ b/src/text.c @@ -700,6 +700,13 @@ void do_redo(void) #endif case JOIN: redidmsg = _("line join"); + /* When the join was done by a Backspace at the tail of the file, + * and the nonewlines flag isn't set, do not join anything, as + * nothing was actually deleted; just position the cursor. */ + if (u->xflags == WAS_FINAL_BACKSPACE && !ISSET(NO_NEWLINES)) { + goto_line_posx(u->mark_begin_lineno, u->mark_begin_x); + break; + } f->data = charealloc(f->data, strlen(f->data) + strlen(u->strdata) + 1); strcat(f->data, u->strdata); if (f->next != NULL) {