updated for version 7.2-226
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index fabb2e7..68627a5 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4013,6 +4013,9 @@
 	    break;
 	ml_delete(eap->line1, FALSE);
     }
+
+    /* make sure the cursor is not beyond the end of the file now */
+    check_cursor_lnum();
     deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum));
 
     /* ":append" on the line above the deleted lines. */