comparison 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
comparison
equal deleted inserted replaced
4302:492821f2921d 4303:790238e5a46c
214 } 214 }
215 #endif 215 #endif
216 216
217 /* 217 /*
218 * Save the current line for both the "u" and "U" command. 218 * Save the current line for both the "u" and "U" command.
219 * Careful: may trigger autocommands that reload the buffer.
219 * Returns OK or FAIL. 220 * Returns OK or FAIL.
220 */ 221 */
221 int 222 int
222 u_save_cursor() 223 u_save_cursor()
223 { 224 {
236 linenr_T top, bot; 237 linenr_T top, bot;
237 { 238 {
238 if (undo_off) 239 if (undo_off)
239 return OK; 240 return OK;
240 241
241 if (top > curbuf->b_ml.ml_line_count || 242 if (top > curbuf->b_ml.ml_line_count
242 top >= bot || bot > curbuf->b_ml.ml_line_count + 1) 243 || top >= bot
244 || bot > curbuf->b_ml.ml_line_count + 1)
243 return FALSE; /* rely on caller to do error messages */ 245 return FALSE; /* rely on caller to do error messages */
244 246
245 if (top + 2 == bot) 247 if (top + 2 == bot)
246 u_saveline((linenr_T)(top + 1)); 248 u_saveline((linenr_T)(top + 1));
247 249