[BACK]Return to undo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/undo.c between version 1.45 and 1.46

version 1.45, 2008/06/11 17:07:37 version 1.46, 2008/06/14 07:38:53
Line 173 
Line 173 
   
 /*  /*
  * If undo is enabled, then:   * If undo is enabled, then:
  *   undo_boundary_enable(FALS) stops recording undo boundaries between actions.   *   undo_boundary_enable(FALSE) stops recording undo boundaries
    *   between actions.
  *   undo_boundary_enable(TRUE) enables undo boundaries.   *   undo_boundary_enable(TRUE) enables undo boundaries.
  * If undo is disabled, this function has no effect.   * If undo is disabled, this function has no effect.
  */   */
Line 443 
Line 444 
         static int       nulled = FALSE;          static int       nulled = FALSE;
         int              lineno;          int              lineno;
   
           if (n < 0)
                   return (FALSE);
   
         dot = find_dot(curwp->w_dotp, curwp->w_doto);          dot = find_dot(curwp->w_dotp, curwp->w_doto);
   
         ptr = curbp->b_undoptr;          ptr = curbp->b_undoptr;
   
         /* if we moved, make ptr point back to the top of the list */          /* first invocation, make ptr point back to the top of the list */
         if ((ptr == NULL && nulled == TRUE) || curbp->b_undopos != dot) {          if ((ptr == NULL && nulled == TRUE) ||  rptcount == 0) {
                 ptr = LIST_FIRST(&curbp->b_undo);                  ptr = LIST_FIRST(&curbp->b_undo);
                 nulled = TRUE;                  nulled = TRUE;
         }          }
Line 515 
Line 519 
                                 ldelete(ptr->region.r_size, KNONE);                                  ldelete(ptr->region.r_size, KNONE);
                                 break;                                  break;
                         case DELETE:                          case DELETE:
                                   lp = curwp->w_dotp;
                                   offset = curwp->w_doto;
                                 region_put_data(ptr->content,                                  region_put_data(ptr->content,
                                     ptr->region.r_size);                                      ptr->region.r_size);
                                   curwp->w_dotp = lp;
                                   curwp->w_doto = offset;
                                 break;                                  break;
                         case BOUNDARY:                          case BOUNDARY:
                                 done = 1;                                  done = 1;

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46