[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.29 and 1.30

version 1.29, 2016/09/04 17:37:06 version 1.30, 2016/10/10 17:28:30
Line 36 
Line 36 
 static u_int    layout_resize_check(struct window *, struct layout_cell *,  static u_int    layout_resize_check(struct window *, struct layout_cell *,
                     enum layout_type);                      enum layout_type);
 static int      layout_resize_pane_grow(struct window *, struct layout_cell *,  static int      layout_resize_pane_grow(struct window *, struct layout_cell *,
                     enum layout_type, int);                      enum layout_type, int, int);
 static int      layout_resize_pane_shrink(struct window *, struct layout_cell *,  static int      layout_resize_pane_shrink(struct window *, struct layout_cell *,
                     enum layout_type, int);                      enum layout_type, int);
 static int      layout_need_status(struct layout_cell *, int);  static int      layout_need_status(struct layout_cell *, int);
Line 532 
Line 532 
                 change = new_size - size;                  change = new_size - size;
   
         /* Resize the pane. */          /* Resize the pane. */
         layout_resize_pane(wp, type, change);          layout_resize_pane(wp, type, change, 1);
 }  }
   
 /* Resize a single pane within the layout. */  /* Resize a single pane within the layout. */
 void  void
 layout_resize_pane(struct window_pane *wp, enum layout_type type, int change)  layout_resize_pane(struct window_pane *wp, enum layout_type type, int change,
       int opposite)
 {  {
         struct window           *w = wp->window;          struct window           *w = wp->window;
         struct layout_cell      *lc, *lcparent;          struct layout_cell      *lc, *lcparent;
Line 562 
Line 563 
         needed = change;          needed = change;
         while (needed != 0) {          while (needed != 0) {
                 if (change > 0) {                  if (change > 0) {
                         size = layout_resize_pane_grow(w, lc, type, needed);                          size = layout_resize_pane_grow(w, lc, type, needed,
                               opposite);
                         needed -= size;                          needed -= size;
                 } else {                  } else {
                         size = layout_resize_pane_shrink(w, lc, type, needed);                          size = layout_resize_pane_shrink(w, lc, type, needed);
Line 582 
Line 584 
 /* Helper function to grow pane. */  /* Helper function to grow pane. */
 static int  static int
 layout_resize_pane_grow(struct window *w, struct layout_cell *lc,  layout_resize_pane_grow(struct window *w, struct layout_cell *lc,
     enum layout_type type, int needed)      enum layout_type type, int needed, int opposite)
 {  {
         struct layout_cell      *lcadd, *lcremove;          struct layout_cell      *lcadd, *lcremove;
         u_int                    size;          u_int                    size = 0;
   
         /* Growing. Always add to the current cell. */          /* Growing. Always add to the current cell. */
         lcadd = lc;          lcadd = lc;
Line 600 
Line 602 
         }          }
   
         /* If none found, look towards the head. */          /* If none found, look towards the head. */
         if (lcremove == NULL) {          if (opposite && lcremove == NULL) {
                 lcremove = TAILQ_PREV(lc, layout_cells, entry);                  lcremove = TAILQ_PREV(lc, layout_cells, entry);
                 while (lcremove != NULL) {                  while (lcremove != NULL) {
                         size = layout_resize_check(w, lcremove, type);                          size = layout_resize_check(w, lcremove, type);
Line 608 
Line 610 
                                 break;                                  break;
                         lcremove = TAILQ_PREV(lcremove, layout_cells, entry);                          lcremove = TAILQ_PREV(lcremove, layout_cells, entry);
                 }                  }
                 if (lcremove == NULL)  
                         return (0);  
         }          }
           if (lcremove == NULL)
                   return (0);
   
         /* Change the cells. */          /* Change the cells. */
         if (size > (u_int) needed)          if (size > (u_int) needed)

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30