[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.12 and 1.13

version 1.12, 2002/07/24 14:08:33 version 1.13, 2002/08/22 23:28:19
Line 61 
Line 61 
  *   *
  * Find an absolute dot in the buffer from a line/offset pair, and vice-versa.   * Find an absolute dot in the buffer from a line/offset pair, and vice-versa.
  *   *
  * Since lines can be deleted while they are referenced by undo record, we   * Since lines can be deleted while they are referenced by undo record, we
  * need to have an absolute dot to have something reliable.   * need to have an absolute dot to have something reliable.
  */   */
   
Line 203 
Line 203 
         return (TRUE);          return (TRUE);
 }  }
   
 /*  /*
  * If asocial is true, we arrange for this record to be let alone.  forever.   * If asocial is true, we arrange for this record to be let alone.  forever.
  * Yes, this is a bit of a hack...   * Yes, this is a bit of a hack...
  */   */
Line 253 
Line 253 
   
         /*          /*
          * We try to reuse the last undo record to `compress' things.           * We try to reuse the last undo record to `compress' things.
          */           */
         rec = LIST_FIRST(&curbp->b_undo);          rec = LIST_FIRST(&curbp->b_undo);
         if (rec != NULL) {          if (rec != NULL) {
                 /* this will be hit like, 80% of the time... */                  /* this will be hit like, 80% of the time... */
Line 385 
Line 385 
   
         num = 0;          num = 0;
         for (rec = LIST_FIRST(&curbp->b_undo); rec != NULL;          for (rec = LIST_FIRST(&curbp->b_undo); rec != NULL;
              rec = LIST_NEXT(rec, next)) {              rec = LIST_NEXT(rec, next)) {
                 num++;                  num++;
                 snprintf(buf, sizeof buf,                  snprintf(buf, sizeof buf,
                     "Record %d =>\t %s at %d ", num,                      "Record %d =>\t %s at %d ", num,
Line 424 
Line 424 
  *      [action1]   *      [action1]
  *       ------   *       ------
  *       [undo]   *       [undo]
  *   *
  * After another undo:   * After another undo:
  *   *
  *   *
Line 433 
Line 433 
  *      [action1]  <--- Undoptr   *      [action1]  <--- Undoptr
  *       ------   *       ------
  *       [undo]   *       [undo]
  *   *
  * Note that the "undo of actionX" have no special meaning. Only when,   * Note that the "undo of actionX" have no special meaning. Only when,
  * say, we undo a deletion, the insertion will be recorded just as if it   * say, we undo a deletion, the insertion will be recorded just as if it
  * was typed on the keyboard. Resulting in the inverse operation being   * was typed on the keyboard. Resulting in the inverse operation being
Line 479 
Line 479 
                         break;                          break;
                 }                  }
   
                 /*                  /*
                  * Loop while we don't get a boundary specifying we've                   * Loop while we don't get a boundary specifying we've
                  * finished the current action...                   * finished the current action...
                  */                   */
Line 515 
Line 515 
                                 ldelete(ptr->region.r_size, KFORW);                                  ldelete(ptr->region.r_size, KFORW);
                                 break;                                  break;
                         case DELETE:                          case DELETE:
                                 region_put_data(ptr->content,                                  region_put_data(ptr->content,
                                     ptr->region.r_size);                                      ptr->region.r_size);
                                 break;                                  break;
                         case BOUNDARY:                          case BOUNDARY:
Line 540 
Line 540 
         curbp->b_undopos.r_linep = curwp->w_dotp;          curbp->b_undopos.r_linep = curwp->w_dotp;
         curbp->b_undopos.r_offset = curwp->w_doto;          curbp->b_undopos.r_offset = curwp->w_doto;
   
         return (rval);          return (rval);
 }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13