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

Diff for /src/usr.bin/tmux/format-draw.c between version 1.12 and 1.13

version 1.12, 2019/07/06 20:37:29 version 1.13, 2019/09/15 21:42:57
Line 513 
Line 513 
         int                      focus_start = -1, focus_end = -1;          int                      focus_start = -1, focus_end = -1;
         int                      list_state = -1, fill = -1;          int                      list_state = -1, fill = -1;
         enum style_align         list_align = STYLE_ALIGN_DEFAULT;          enum style_align         list_align = STYLE_ALIGN_DEFAULT;
         struct grid_cell         gc;          struct grid_cell         gc, current_default;
         struct style             sy;          struct style             sy, saved_sy;
         struct utf8_data        *ud = &sy.gc.data;          struct utf8_data        *ud = &sy.gc.data;
         const char              *cp, *end;          const char              *cp, *end;
         enum utf8_state          more;          enum utf8_state          more;
Line 523 
Line 523 
         struct format_ranges     frs;          struct format_ranges     frs;
         struct style_range      *sr;          struct style_range      *sr;
   
         style_set(&sy, base);          memcpy(&current_default, base, sizeof current_default);
           style_set(&sy, &current_default);
         TAILQ_INIT(&frs);          TAILQ_INIT(&frs);
         log_debug("%s: %s", __func__, expanded);          log_debug("%s: %s", __func__, expanded);
   
Line 535 
Line 536 
         for (i = 0; i < TOTAL; i++) {          for (i = 0; i < TOTAL; i++) {
                 screen_init(&s[i], size, 1, 0);                  screen_init(&s[i], size, 1, 0);
                 screen_write_start(&ctx[i], NULL, &s[i]);                  screen_write_start(&ctx[i], NULL, &s[i]);
                 screen_write_clearendofline(&ctx[i], base->bg);                  screen_write_clearendofline(&ctx[i], current_default.bg);
                 width[i] = 0;                  width[i] = 0;
         }          }
   
Line 581 
Line 582 
                         goto out;                          goto out;
                 }                  }
                 tmp = xstrndup(cp + 2, end - (cp + 2));                  tmp = xstrndup(cp + 2, end - (cp + 2));
                 if (style_parse(&sy, base, tmp) != 0) {                  style_copy(&saved_sy, &sy);
                   if (style_parse(&sy, &current_default, tmp) != 0) {
                         log_debug("%s: invalid style '%s'", __func__, tmp);                          log_debug("%s: invalid style '%s'", __func__, tmp);
                         free(tmp);                          free(tmp);
                         cp = end + 1;                          cp = end + 1;
Line 594 
Line 596 
                 /* If this style has a fill colour, store it for later. */                  /* If this style has a fill colour, store it for later. */
                 if (sy.fill != 8)                  if (sy.fill != 8)
                         fill = sy.fill;                          fill = sy.fill;
   
                   /* If this style pushed or popped the default, update it. */
                   if (sy.default_type == STYLE_DEFAULT_PUSH) {
                           memcpy(&current_default, &saved_sy.gc, sizeof current_default);
                           sy.default_type = STYLE_DEFAULT_BASE;
                   } else if (sy.default_type == STYLE_DEFAULT_POP) {
                           memcpy(&current_default, base, sizeof current_default);
                           sy.default_type = STYLE_DEFAULT_BASE;
                   }
   
                 /* Check the list state. */                  /* Check the list state. */
                 switch (sy.list) {                  switch (sy.list) {

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13