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

Diff for /src/usr.bin/mg/util.c between version 1.38 and 1.39

version 1.38, 2015/11/18 18:21:06 version 1.39, 2018/12/18 20:35:34
Line 411 
Line 411 
  * Delete forward.  This is real easy, because the basic delete routine does   * Delete forward.  This is real easy, because the basic delete routine does
  * all of the work.  Watches for negative arguments, and does the right thing.   * all of the work.  Watches for negative arguments, and does the right thing.
  * If any argument is present, it kills rather than deletes, to prevent loss   * If any argument is present, it kills rather than deletes, to prevent loss
  * of text if typed with a big argument.  Normally bound to "C-D".   * of text if typed with a big argument.  Normally bound to "C-d".
    * If the cursor is in a region, kill the region.
  */   */
 /* ARGSUSED */  /* ARGSUSED */
 int  int
Line 420 
Line 421 
         if (n < 0)          if (n < 0)
                 return (backdel(f | FFRAND, -n));                  return (backdel(f | FFRAND, -n));
   
           if (curwp->w_markp != NULL)
                   return(killregion(FFRAND, 1));
   
         /* really a kill */          /* really a kill */
         if (f & FFARG) {          if (f & FFARG) {
                 if ((lastflag & CFKILL) == 0)                  if ((lastflag & CFKILL) == 0)
Line 434 
Line 438 
  * Delete backwards.  This is quite easy too, because it's all done with   * Delete backwards.  This is quite easy too, because it's all done with
  * other functions.  Just move the cursor back, and delete forwards.  Like   * other functions.  Just move the cursor back, and delete forwards.  Like
  * delete forward, this actually does a kill if presented with an argument.   * delete forward, this actually does a kill if presented with an argument.
    * If the cursor is in a region, kill the region.
  */   */
 /* ARGSUSED */  /* ARGSUSED */
 int  int
Line 443 
Line 448 
   
         if (n < 0)          if (n < 0)
                 return (forwdel(f | FFRAND, -n));                  return (forwdel(f | FFRAND, -n));
   
           if (curwp->w_markp != NULL)
                   return (killregion(FFRAND, 1));
   
         /* really a kill */          /* really a kill */
         if (f & FFARG) {          if (f & FFARG) {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39