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

Diff for /src/usr.bin/tmux/grid.c between version 1.85 and 1.86

version 1.85, 2018/07/11 06:43:45 version 1.86, 2018/07/11 06:51:39
Line 286 
Line 286 
         return (0);          return (0);
 }  }
   
   /* Trim lines from the history. */
   static void
   grid_trim_history(struct grid *gd, u_int ny)
   {
           grid_free_lines(gd, 0, ny);
           memmove(&gd->linedata[0], &gd->linedata[ny],
               (gd->hsize + gd->sy - ny) * (sizeof *gd->linedata));
   }
   
 /*  /*
  * Collect lines from the history if at the limit. Free the top (oldest) 10%   * Collect lines from the history if at the limit. Free the top (oldest) 10%
  * and shift up.   * and shift up.
Line 308 
Line 317 
          * Free the lines from 0 to ny then move the remaining lines over           * Free the lines from 0 to ny then move the remaining lines over
          * them.           * them.
          */           */
         grid_free_lines(gd, 0, ny);          grid_trim_history(gd, ny);
         memmove(&gd->linedata[0], &gd->linedata[ny],  
             (gd->hsize + gd->sy - ny) * (sizeof *gd->linedata));  
   
         gd->hsize -= ny;          gd->hsize -= ny;
         if (gd->hscrolled > gd->hsize)          if (gd->hscrolled > gd->hsize)
Line 340 
Line 347 
 void  void
 grid_clear_history(struct grid *gd)  grid_clear_history(struct grid *gd)
 {  {
         grid_free_lines(gd, 0, gd->hsize);          grid_trim_history(gd, gd->hsize);
         memmove(&gd->linedata[0], &gd->linedata[gd->hsize],  
             gd->sy * (sizeof *gd->linedata));  
   
         gd->hscrolled = 0;          gd->hscrolled = 0;
         gd->hsize = 0;          gd->hsize = 0;

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86