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

Diff for /src/usr.bin/tmux/layout.c between version 1.41 and 1.42

version 1.41, 2019/04/17 14:43:49 version 1.42, 2019/04/17 14:44:33
Line 834 
Line 834 
     int flags)      int flags)
 {  {
         struct layout_cell     *lc, *lcparent, *lcnew, *lc1, *lc2;          struct layout_cell     *lc, *lcparent, *lcnew, *lc1, *lc2;
         u_int                   sx, sy, xoff, yoff, size1, size2;          u_int                   sx, sy, xoff, yoff, size1, size2, minimum;
         u_int                   new_size, saved_size, resize_first = 0;          u_int                   new_size, saved_size, resize_first = 0;
         int                     full_size = (flags & SPAWN_FULLSIZE);          int                     full_size = (flags & SPAWN_FULLSIZE), status;
   
         /*          /*
          * If full_size is specified, add a new cell at the top of the window           * If full_size is specified, add a new cell at the top of the window
Line 846 
Line 846 
                 lc = wp->window->layout_root;                  lc = wp->window->layout_root;
         else          else
                 lc = wp->layout_cell;                  lc = wp->layout_cell;
           status = options_get_number(wp->window->options, "pane-border-status");
   
         /* Copy the old cell size. */          /* Copy the old cell size. */
         sx = lc->sx;          sx = lc->sx;
Line 860 
Line 861 
                         return (NULL);                          return (NULL);
                 break;                  break;
         case LAYOUT_TOPBOTTOM:          case LAYOUT_TOPBOTTOM:
                 if (sy < PANE_MINIMUM * 2 + 1)                  minimum = PANE_MINIMUM * 2 + 1;
                   if (status != 0)
                           minimum += layout_need_status(lc, status == 1);
                   if (sy < minimum)
                         return (NULL);                          return (NULL);
                 break;                  break;
         default:          default:
Line 1012 
Line 1016 
 layout_spread_cell(struct window *w, struct layout_cell *parent)  layout_spread_cell(struct window *w, struct layout_cell *parent)
 {  {
         struct layout_cell      *lc;          struct layout_cell      *lc;
         u_int                    number, each, size;          u_int                    number, each, size, this;
         int                      change, changed;          int                      change, changed, status;
   
         number = 0;          number = 0;
         TAILQ_FOREACH (lc, &parent->cells, entry)          TAILQ_FOREACH (lc, &parent->cells, entry)
             number++;              number++;
         if (number <= 1)          if (number <= 1)
                 return (0);                  return (0);
           status = options_get_number(w->options, "pane-border-status");
   
         if (parent->type == LAYOUT_LEFTRIGHT)          if (parent->type == LAYOUT_LEFTRIGHT)
                 size = parent->sx;                  size = parent->sx;
         else if (parent->type == LAYOUT_TOPBOTTOM)          else if (parent->type == LAYOUT_TOPBOTTOM) {
                 size = parent->sy;                  size = parent->sy;
         else                  if (status != 0)
                           size -= layout_need_status(parent, status == 1);
           } else
                 return (0);                  return (0);
           if (size < number - 1)
                   return (0);
         each = (size - (number - 1)) / number;          each = (size - (number - 1)) / number;
           if (each == 0)
                   return (0);
   
         changed = 0;          changed = 0;
         TAILQ_FOREACH (lc, &parent->cells, entry) {          TAILQ_FOREACH (lc, &parent->cells, entry) {
Line 1038 
Line 1049 
                         change = each - (int)lc->sx;                          change = each - (int)lc->sx;
                         layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, change);                          layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, change);
                 } else if (parent->type == LAYOUT_TOPBOTTOM) {                  } else if (parent->type == LAYOUT_TOPBOTTOM) {
                         change = each - (int)lc->sy;                          this = each;
                           if (status != 0)
                                   this += layout_need_status(lc, status == 1);
                           change = this - (int)lc->sy;
                         layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, change);                          layout_resize_adjust(w, lc, LAYOUT_TOPBOTTOM, change);
                 }                  }
                 if (change != 0)                  if (change != 0)

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42