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

Diff for /src/usr.bin/tmux/options.c between version 1.39 and 1.40

version 1.39, 2019/03/18 11:58:40 version 1.40, 2019/03/18 21:46:02
Line 78 
Line 78 
             ((o)->tableentry->type == OPTIONS_TABLE_NUMBER ||           \              ((o)->tableentry->type == OPTIONS_TABLE_NUMBER ||           \
             (o)->tableentry->type == OPTIONS_TABLE_KEY ||               \              (o)->tableentry->type == OPTIONS_TABLE_KEY ||               \
             (o)->tableentry->type == OPTIONS_TABLE_COLOUR ||            \              (o)->tableentry->type == OPTIONS_TABLE_COLOUR ||            \
             (o)->tableentry->type == OPTIONS_TABLE_ATTRIBUTES ||        \  
             (o)->tableentry->type == OPTIONS_TABLE_FLAG ||              \              (o)->tableentry->type == OPTIONS_TABLE_FLAG ||              \
             (o)->tableentry->type == OPTIONS_TABLE_CHOICE))              (o)->tableentry->type == OPTIONS_TABLE_CHOICE))
 #define OPTIONS_IS_STYLE(o) \  #define OPTIONS_IS_STYLE(o) \
Line 416 
Line 415 
                 case OPTIONS_TABLE_COLOUR:                  case OPTIONS_TABLE_COLOUR:
                         tmp = colour_tostring(o->number);                          tmp = colour_tostring(o->number);
                         break;                          break;
                 case OPTIONS_TABLE_ATTRIBUTES:  
                         tmp = attributes_tostring(o->number);  
                         break;  
                 case OPTIONS_TABLE_FLAG:                  case OPTIONS_TABLE_FLAG:
                         if (numeric)                          if (numeric)
                                 xsnprintf(s, sizeof s, "%lld", o->number);                                  xsnprintf(s, sizeof s, "%lld", o->number);
Line 707 
Line 703 
                 *oo = s->options;                  *oo = s->options;
                 return (OPTIONS_TABLE_SESSION);                  return (OPTIONS_TABLE_SESSION);
         }          }
 }  
   
 void  
 options_style_update_new(struct options *oo, struct options_entry *o)  
 {  
         const char              *newname = o->tableentry->style;  
         struct options_entry    *new;  
   
         if (newname == NULL)  
                 return;  
         new = options_get_only(oo, newname);  
         if (new == NULL)  
                 new = options_set_style(oo, newname, 0, "default");  
   
         if (strstr(o->name, "-bg") != NULL)  
                 new->style.gc.bg = o->number;  
         else if (strstr(o->name, "-fg") != NULL)  
                 new->style.gc.fg = o->number;  
         else if (strstr(o->name, "-attr") != NULL)  
                 new->style.gc.attr = o->number;  
 }  
   
 void  
 options_style_update_old(struct options *oo, struct options_entry *o)  
 {  
         char    newname[128];  
         int     size;  
   
         size = strrchr(o->name, '-') - o->name;  
   
         xsnprintf(newname, sizeof newname, "%.*s-bg", size, o->name);  
         if (options_get(oo, newname) != NULL)  
                 options_set_number(oo, newname, o->style.gc.bg);  
   
         xsnprintf(newname, sizeof newname, "%.*s-fg", size, o->name);  
         if (options_get(oo, newname) != NULL)  
                 options_set_number(oo, newname, o->style.gc.fg);  
   
         xsnprintf(newname, sizeof newname, "%.*s-attr", size, o->name);  
         if (options_get(oo, newname) != NULL)  
                 options_set_number(oo, newname, o->style.gc.attr);  
 }  }

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40