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

Diff for /src/usr.bin/tmux/style.c between version 1.23 and 1.24

version 1.23, 2019/07/06 20:37:29 version 1.24, 2019/09/15 21:42:57
Line 36 
Line 36 
         STYLE_ALIGN_DEFAULT,          STYLE_ALIGN_DEFAULT,
         STYLE_LIST_OFF,          STYLE_LIST_OFF,
   
         STYLE_RANGE_NONE, 0          STYLE_RANGE_NONE, 0,
   
           STYLE_DEFAULT_BASE
 };  };
   
 /*  /*
  * Parse an embedded style of the form "fg=colour,bg=colour,bright,...".   * Parse an embedded style of the form "fg=colour,bg=colour,bright,...".  Note
  * Note that this adds onto the given style, so it must have been initialized   * that this adds onto the given style, so it must have been initialized
  * alredy.   * already.
  */   */
 int  int
 style_parse(struct style *sy, const struct grid_cell *base, const char *in)  style_parse(struct style *sy, const struct grid_cell *base, const char *in)
Line 74 
Line 76 
                         sy->gc.bg = base->bg;                          sy->gc.bg = base->bg;
                         sy->gc.attr = base->attr;                          sy->gc.attr = base->attr;
                         sy->gc.flags = base->flags;                          sy->gc.flags = base->flags;
                 } else if (strcasecmp(tmp, "nolist") == 0)                  } else if (strcasecmp(tmp, "push-default") == 0)
                           sy->default_type = STYLE_DEFAULT_PUSH;
                   else if (strcasecmp(tmp, "pop-default") == 0)
                           sy->default_type = STYLE_DEFAULT_POP;
                   else if (strcasecmp(tmp, "nolist") == 0)
                         sy->list = STYLE_LIST_OFF;                          sy->list = STYLE_LIST_OFF;
                 else if (strncasecmp(tmp, "list=", 5) == 0) {                  else if (strncasecmp(tmp, "list=", 5) == 0) {
                         if (strcasecmp(tmp + 5, "on") == 0)                          if (strcasecmp(tmp + 5, "on") == 0)
Line 218 
Line 224 
                     tmp);                      tmp);
                 comma = ",";                  comma = ",";
         }          }
           if (sy->default_type != STYLE_DEFAULT_BASE) {
                   if (sy->default_type == STYLE_DEFAULT_PUSH)
                           tmp = "push-default";
                   else if (sy->default_type == STYLE_DEFAULT_POP)
                           tmp = "pop-default";
                   off += xsnprintf(s + off, sizeof s - off, "%s%s", comma, tmp);
                   comma = ",";
           }
         if (sy->fill != 8) {          if (sy->fill != 8) {
                 off += xsnprintf(s + off, sizeof s - off, "%sfill=%s", comma,                  off += xsnprintf(s + off, sizeof s - off, "%sfill=%s", comma,
                     colour_tostring(sy->fill));                      colour_tostring(sy->fill));
Line 255 
Line 269 
         gc->fg = sy->gc.fg;          gc->fg = sy->gc.fg;
         gc->bg = sy->gc.bg;          gc->bg = sy->gc.bg;
         gc->attr |= sy->gc.attr;          gc->attr |= sy->gc.attr;
 }  
   
 /* Apply a style, updating if default. */  
 void  
 style_apply_update(struct grid_cell *gc, struct options *oo, const char *name)  
 {  
         struct style    *sy;  
   
         sy = options_get_style(oo, name);  
         if (sy->gc.fg != 8)  
                 gc->fg = sy->gc.fg;  
         if (sy->gc.bg != 8)  
                 gc->bg = sy->gc.bg;  
         if (sy->gc.attr != 0)  
                 gc->attr |= sy->gc.attr;  
 }  }
   
 /* Initialize style from cell. */  /* Initialize style from cell. */

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24