diff --git a/ChangeLog b/ChangeLog
index bba91821cc00fe29710c9dfeeda0a02d04556d4d..e54f0327f119d74a9f59db1ff4de60187d647c0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-29  Mark Majeres  <mark@engine12.com>
+	* src/text.c (do_undo): Update the pointer to the bottom of the file
+	when undoing line deletions at file's end.
+
 2014-06-28  Benno Schulenberg  <bensberg@justemail.net>
 	* src/prompt.c (do_statusbar_input): Remove the useless parameters
 	'have_shortcut and 'allow_funcs'; the latter is only ever TRUE.
diff --git a/src/text.c b/src/text.c
index 132ac2346c2eb82e387f2c2a721623cf367df443..cb050e2a29bf8a47e9808ba46532794d7460a8d5 100644
--- a/src/text.c
+++ b/src/text.c
@@ -486,6 +486,8 @@ void do_undo(void)
 	free(f->data);
 	f->data = data;
 	splice_node(f, t, f->next);
+	if (f == openfile->filebot)
+	    openfile->filebot = t;
 	goto_line_posx(u->lineno, u->begin);
 	break;
     case CUT_EOF: