diff src/undo.c @ 4303:790238e5a46c v7.3.901

updated for version 7.3.901 Problem: Outdated comment, ugly condition. Solution: Update a few comments, break line.
author Bram Moolenaar <bram@vim.org>
date Mon, 15 Apr 2013 15:47:12 +0200
parents b7eea2409507
children 60301d4d1682
line wrap: on
line diff
--- a/src/undo.c
+++ b/src/undo.c
@@ -216,6 +216,7 @@ u_check(int newhead_may_be_NULL)
 
 /*
  * Save the current line for both the "u" and "U" command.
+ * Careful: may trigger autocommands that reload the buffer.
  * Returns OK or FAIL.
  */
     int
@@ -238,8 +239,9 @@ u_save(top, bot)
     if (undo_off)
 	return OK;
 
-    if (top > curbuf->b_ml.ml_line_count ||
-			    top >= bot || bot > curbuf->b_ml.ml_line_count + 1)
+    if (top > curbuf->b_ml.ml_line_count
+	    || top >= bot
+	    || bot > curbuf->b_ml.ml_line_count + 1)
 	return FALSE;	/* rely on caller to do error messages */
 
     if (top + 2 == bot)