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

Diff for /src/usr.bin/tmux/tty.c between version 1.202 and 1.203

version 1.202, 2016/05/30 09:26:49 version 1.203, 2016/05/30 09:50:21
Line 676 
Line 676 
         struct grid_cell        gc;          struct grid_cell        gc;
   
         memcpy(&gc, &grid_default_cell, sizeof gc);          memcpy(&gc, &grid_default_cell, sizeof gc);
         tty_default_colours(&gc, wp);          if (wp != NULL)
                   tty_default_colours(&gc, wp);
   
         if (gc.bg == 8 && !(gc.flags & GRID_FLAG_BG256))          if (gc.bg == 8 && !(gc.flags & GRID_FLAG_BG256))
                 return (0);                  return (0);
Line 1133 
Line 1134 
 {  {
         struct window_pane      *wp = ctx->wp;          struct window_pane      *wp = ctx->wp;
         struct screen           *s = wp->screen;          struct screen           *s = wp->screen;
         u_int                    cx;          u_int                    cx, width;
         u_int                    width;  
   
         tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);          if (ctx->ocy == ctx->orlower)
                   tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
   
         /* Is the cursor in the very last position? */          /* Is the cursor in the very last position? */
         width = ctx->cell->data.width;          width = ctx->cell->data.width;
Line 1443 
Line 1444 
         u_char                   changed;          u_char                   changed;
   
         memcpy(&gc2, gc, sizeof gc2);          memcpy(&gc2, gc, sizeof gc2);
         tty_default_colours(&gc2, wp);          if (wp != NULL)
                   tty_default_colours(&gc2, wp);
   
         /*          /*
          * If no setab, try to use the reverse attribute as a best-effort for a           * If no setab, try to use the reverse attribute as a best-effort for a
Line 1793 
Line 1795 
 void  void
 tty_default_colours(struct grid_cell *gc, const struct window_pane *wp)  tty_default_colours(struct grid_cell *gc, const struct window_pane *wp)
 {  {
         const struct grid_cell        *agc, *pgc, *wgc;          struct window           *w = wp->window;
           struct options          *oo = w->options;
           const struct grid_cell  *agc, *pgc, *wgc;
   
         if (wp == NULL)          if (w->flags & WINDOW_STYLECHANGED) {
                 return;                  w->flags &= ~WINDOW_STYLECHANGED;
                   agc = options_get_style(oo, "window-active-style");
                   memcpy(&w->active_style, agc, sizeof w->active_style);
                   wgc = options_get_style(oo, "window-style");
                   memcpy(&w->style, wgc, sizeof w->style);
           } else {
                   agc = &w->active_style;
                   wgc = &w->style;
           }
         pgc = &wp->colgc;          pgc = &wp->colgc;
         agc = options_get_style(wp->window->options, "window-active-style");  
         wgc = options_get_style(wp->window->options, "window-style");  
   
         if (gc->fg == 8 && !(gc->flags & GRID_FLAG_FG256)) {          if (gc->fg == 8 && !(gc->flags & GRID_FLAG_FG256)) {
                 if (pgc->fg != 8 || (pgc->flags & GRID_FLAG_FG256)) {                  if (pgc->fg != 8 || (pgc->flags & GRID_FLAG_FG256)) {
                         gc->fg = pgc->fg;                          gc->fg = pgc->fg;
                         gc->flags |= (pgc->flags & GRID_FLAG_FG256);                          gc->flags |= (pgc->flags & GRID_FLAG_FG256);
                 } else if (wp == wp->window->active &&                  } else if (wp == w->active &&
                     (agc->fg != 8 || (agc->flags & GRID_FLAG_FG256))) {                      (agc->fg != 8 || (agc->flags & GRID_FLAG_FG256))) {
                         gc->fg = agc->fg;                          gc->fg = agc->fg;
                         gc->flags |= (agc->flags & GRID_FLAG_FG256);                          gc->flags |= (agc->flags & GRID_FLAG_FG256);
Line 1820 
Line 1829 
                 if (pgc->bg != 8 || (pgc->flags & GRID_FLAG_BG256)) {                  if (pgc->bg != 8 || (pgc->flags & GRID_FLAG_BG256)) {
                         gc->bg = pgc->bg;                          gc->bg = pgc->bg;
                         gc->flags |= (pgc->flags & GRID_FLAG_BG256);                          gc->flags |= (pgc->flags & GRID_FLAG_BG256);
                 } else if (wp == wp->window->active &&                  } else if (wp == w->active &&
                     (agc->bg != 8 || (agc->flags & GRID_FLAG_BG256))) {                      (agc->bg != 8 || (agc->flags & GRID_FLAG_BG256))) {
                         gc->bg = agc->bg;                          gc->bg = agc->bg;
                         gc->flags |= (agc->flags & GRID_FLAG_BG256);                          gc->flags |= (agc->flags & GRID_FLAG_BG256);

Legend:
Removed from v.1.202  
changed lines
  Added in v.1.203