Index: src/text.c =================================================================== --- src/text.c (revision 4988) +++ src/text.c (working copy) @@ -396,7 +396,7 @@ free_filestruct(cutbuffer); cutbuffer = NULL; - if (u->xflags == UNcut_cutline || u->xflags == UNcut_marked_backwards) + if (u->xflags == UNcut_cutline || u->xflags == UNcut_marked_backwards || u->type == CUT_EOF) goto_line_posx(u->mark_begin_lineno, u->mark_begin_x); } @@ -455,7 +455,7 @@ fprintf(stderr, "data we're about to undo = \"%s\"\n", f->data); fprintf(stderr, "Undo running for type %d\n", u->type); #endif - + openfile->mark_set = FALSE; openfile->current_x = u->begin; switch (u->type) { case ADD: @@ -589,7 +589,7 @@ fprintf(stderr, "data we're about to redo = \"%s\"\n", f->data); fprintf(stderr, "Redo running for type %d\n", u->type); #endif - + openfile->mark_set = FALSE; switch (u->type) { case ADD: undidmsg = _("text add"); @@ -937,6 +937,8 @@ u->strdata = data; break; case CUT_EOF: + cutbuffer_reset(); + break; case CUT: cutbuffer_reset(); u->mark_set = openfile->mark_set; @@ -944,7 +946,7 @@ u->mark_begin_lineno = openfile->mark_begin->lineno; u->mark_begin_x = openfile->mark_begin_x; } - else if (!ISSET(CUT_TO_END) && u->type != CUT_EOF) { + else if (!ISSET(CUT_TO_END)) { /* The entire line is being cut regardless of the cursor position. */ u->begin = 0; u->xflags = UNcut_cutline;