diff --git a/src/text.c b/src/text.c
index f55bbb6a9ae109bc99bd3ba86fc1981febc5ecba..3c396be58f87262a5ad7edfcd4e8db46ec01394d 100644
--- a/src/text.c
+++ b/src/text.c
@@ -671,7 +671,8 @@ void undo_cut(undo *u)
 	copy_from_buffer(u->cutbuffer);
 
 	/* If the final line was originally cut, remove the extra magicline. */
-	if ((u->xflags & WAS_FINAL_LINE) && !ISSET(NO_NEWLINES))
+	if ((u->xflags & WAS_FINAL_LINE) && !ISSET(NO_NEWLINES) &&
+			openfile->current != openfile->filebot)
 		remove_magicline();
 
 	if (!(u->xflags & WAS_MARKED_FORWARD) && u->type != PASTE)