comparison src/undo.c @ 766:f0d0d3d3a1e2

updated for version 7.0225
author vimboss
date Wed, 15 Mar 2006 22:59:18 +0000
parents d591d4ceeaee
children aaaca5077255
comparison
equal deleted inserted replaced
765:335444c09581 766:f0d0d3d3a1e2
293 */ 293 */
294 uhp = (u_header_T *)U_ALLOC_LINE((unsigned)sizeof(u_header_T)); 294 uhp = (u_header_T *)U_ALLOC_LINE((unsigned)sizeof(u_header_T));
295 if (uhp == NULL) 295 if (uhp == NULL)
296 goto nomem; 296 goto nomem;
297 } 297 }
298 else
299 uhp = NULL;
298 300
299 /* 301 /*
300 * If we undid more than we redid, move the entry lists before and 302 * If we undid more than we redid, move the entry lists before and
301 * including curbuf->b_u_curhead to an alternate branch. 303 * including curbuf->b_u_curhead to an alternate branch.
302 */ 304 */
324 uhfree = uhfree->uh_alt_next; 326 uhfree = uhfree->uh_alt_next;
325 u_freebranch(curbuf, uhfree, &old_curhead); 327 u_freebranch(curbuf, uhfree, &old_curhead);
326 } 328 }
327 } 329 }
328 330
329 if (p_ul < 0) /* no undo at all */ 331 if (uhp == NULL) /* no undo at all */
330 { 332 {
331 if (old_curhead != NULL) 333 if (old_curhead != NULL)
332 u_freebranch(curbuf, old_curhead, NULL); 334 u_freebranch(curbuf, old_curhead, NULL);
333 curbuf->b_u_synced = FALSE; 335 curbuf->b_u_synced = FALSE;
334 return OK; 336 return OK;
652 int mark; 654 int mark;
653 int nomark; 655 int nomark;
654 int round; 656 int round;
655 int dosec = sec; 657 int dosec = sec;
656 int above = FALSE; 658 int above = FALSE;
659
660 /* First make sure the current undoable change is synced. */
661 if (curbuf->b_u_synced == FALSE)
662 u_sync();
657 663
658 u_newcount = 0; 664 u_newcount = 0;
659 u_oldcount = 0; 665 u_oldcount = 0;
660 if (curbuf->b_ml.ml_flags & ML_EMPTY) 666 if (curbuf->b_ml.ml_flags & ML_EMPTY)
661 u_oldcount = -1; 667 u_oldcount = -1;