From: Benno Schulenberg Date: Mon, 30 Nov 2015 15:49:37 +0000 (+0000) Subject: Redoing cuts at EOF properly. X-Git-Tag: v2.5.0~28 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6b1566023ad7f50f2a5ab31a58d717f3579711dc;p=nano.git Redoing cuts at EOF properly. This fixes Savannah bug #46541. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5455 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 3ef46487..9ba5f935 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-11-30 Benno Schulenberg + * src/text.c (redo_cut, update_undo): When cutting reaches the EOF, + and NONEWLINES is set, there is no next line at which to put the + cutting point for a redo. So put it at the very end of the cut. + This fixes Savannah bug #46541. + 2015-11-29 Benno Schulenberg * src/color.c (reset_multis): Evaluate correctly whether to reset the multidata cache. This fixes Savannah bug #46543. diff --git a/src/text.c b/src/text.c index c0bcc35b..ff9872b7 100644 --- a/src/text.c +++ b/src/text.c @@ -451,11 +451,6 @@ void redo_cut(undo *u) goto_line_posx(u->lineno, u->begin); - if (ISSET(NO_NEWLINES) && openfile->current->lineno != u->lineno) { - openfile->current_x = strlen(openfile->current->data); - openfile->placewewant = xplustabs(); - } - openfile->mark_set = TRUE; openfile->mark_begin = fsfromline(u->mark_begin_lineno); openfile->mark_begin_x = (u->xflags == WAS_WHOLE_LINE) ? 0 : u->mark_begin_x; @@ -1140,7 +1135,9 @@ fprintf(stderr, " >> Updating... action = %d, openfile->last_action = %d, openf u->begin = strlen(u->cutbottom->data); if (u->lineno == u->mark_begin_lineno) u->begin += u->mark_begin_x; - } + } else if (openfile->current == openfile->filebot && + ISSET(NO_NEWLINES)) + u->begin = strlen(u->cutbottom->data); } break; case REPLACE: