diff --git a/ChangeLog b/ChangeLog
index 564a0e2f3adfde55f2a3fbd8faa67c086536a71a..b7e0b346dd0a8f73e63a1acbf7a2d8142f836414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-21  Mark Majeres  <mark@engine12.com>
+	* 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.
+
 2014-06-21  David Lawrence Ramsey  <pooka109@gmail.com>
 	* src/move.c, src/nano.c: Miscellaneous whitespace fixes, one
 	type fix, and one more #ifdef NANO_TINY.
diff --git a/src/text.c b/src/text.c
index 791dab9bba1e3464999745e60f274c8095396ccb..8138d20a01ae8c94f15d554be97490b217f4a6bc 100644
--- a/src/text.c
+++ b/src/text.c
@@ -396,7 +396,7 @@ void undo_cut(undo *u)
     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);
 }
 
@@ -937,6 +937,8 @@ void add_undo(undo_type current_action)
 	u->strdata = data;
 	break;
     case CUT_EOF:
+	cutbuffer_reset();
+	break;
     case CUT:
 	cutbuffer_reset();
 	u->mark_set = openfile->mark_set;
@@ -944,7 +946,7 @@ void add_undo(undo_type current_action)
 	    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;