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

Diff for /src/usr.bin/tmux/status.c between version 1.119 and 1.120

version 1.119, 2015/01/20 10:57:10 version 1.120, 2015/02/01 23:43:23
Line 75 
Line 75 
   
 /* Retrieve options for left string. */  /* Retrieve options for left string. */
 char *  char *
 status_redraw_get_left(struct client *c,  status_redraw_get_left(struct client *c, time_t t, int utf8flag,
     time_t t, int utf8flag, struct grid_cell *gc, size_t *size)      struct grid_cell *gc, size_t *size)
 {  {
         struct session  *s = c->session;          struct session  *s = c->session;
           const char      *template;
         char            *left;          char            *left;
         size_t           leftlen;          size_t           leftlen;
   
         style_apply_update(gc, &s->options, "status-left-style");          style_apply_update(gc, &s->options, "status-left-style");
   
         left = status_replace(c, NULL,          template = options_get_string(&s->options, "status-left");
             NULL, NULL, options_get_string(&s->options, "status-left"), t, 1);          left = status_replace(c, NULL, template , t, 1);
   
         *size = options_get_number(&s->options, "status-left-length");          *size = options_get_number(&s->options, "status-left-length");
         leftlen = screen_write_cstrlen(utf8flag, "%s", left);          leftlen = screen_write_cstrlen(utf8flag, "%s", left);
Line 96 
Line 97 
   
 /* Retrieve options for right string. */  /* Retrieve options for right string. */
 char *  char *
 status_redraw_get_right(struct client *c,  status_redraw_get_right(struct client *c, time_t t, int utf8flag,
     time_t t, int utf8flag, struct grid_cell *gc, size_t *size)      struct grid_cell *gc, size_t *size)
 {  {
         struct session  *s = c->session;          struct session  *s = c->session;
           const char      *template;
         char            *right;          char            *right;
         size_t           rightlen;          size_t           rightlen;
   
         style_apply_update(gc, &s->options, "status-right-style");          style_apply_update(gc, &s->options, "status-right-style");
   
         right = status_replace(c, NULL,          template = options_get_string(&s->options, "status-right");
             NULL, NULL, options_get_string(&s->options, "status-right"), t, 1);          right = status_replace(c, NULL, template, t, 1);
   
         *size = options_get_number(&s->options, "status-right-length");          *size = options_get_number(&s->options, "status-right-length");
         rightlen = screen_write_cstrlen(utf8flag, "%s", right);          rightlen = screen_write_cstrlen(utf8flag, "%s", right);
Line 432 
Line 434 
   
 /* Replace special sequences in fmt. */  /* Replace special sequences in fmt. */
 char *  char *
 status_replace(struct client *c, struct session *s, struct winlink *wl,  status_replace(struct client *c, struct winlink *wl, const char *fmt, time_t t,
     struct window_pane *wp, const char *fmt, time_t t, int jobsflag)      int jobsflag)
 {  {
           struct session          *s = NULL;
           struct window_pane      *wp = NULL;
         static char              out[BUFSIZ];          static char              out[BUFSIZ];
         char                     in[BUFSIZ], ch, *iptr, *optr, *expanded;          char                     in[BUFSIZ], ch, *iptr, *optr, *expanded;
         size_t                   len;          size_t                   len;
Line 443 
Line 447 
         if (fmt == NULL)          if (fmt == NULL)
                 return (xstrdup(""));                  return (xstrdup(""));
   
         if (s == NULL && c != NULL)          if (c != NULL)
                 s = c->session;                  s = c->session;
         if (wl == NULL && s != NULL)          if (wl == NULL && s != NULL)
                 wl = s->curw;                  wl = s->curw;
         if (wp == NULL && wl != NULL)          if (wl != NULL)
                 wp = wl->window->active;                  wp = wl->window->active;
   
         len = strftime(in, sizeof in, fmt, localtime(&t));          len = strftime(in, sizeof in, fmt, localtime(&t));
Line 620 
Line 624 
   
 /* Return winlink status line entry and adjust gc as necessary. */  /* Return winlink status line entry and adjust gc as necessary. */
 char *  char *
 status_print(  status_print(struct client *c, struct winlink *wl, time_t t,
     struct client *c, struct winlink *wl, time_t t, struct grid_cell *gc)      struct grid_cell *gc)
 {  {
         struct options  *oo = &wl->window->options;          struct options  *oo = &wl->window->options;
         struct session  *s = c->session;          struct session  *s = c->session;
Line 642 
Line 646 
         else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE))          else if (wl->flags & (WINLINK_ACTIVITY|WINLINK_SILENCE))
                 style_apply_update(gc, oo, "window-status-activity-style");                  style_apply_update(gc, oo, "window-status-activity-style");
   
         text = status_replace(c, NULL, wl, NULL, fmt, t, 1);          text = status_replace(c, wl, fmt, t, 1);
         return (text);          return (text);
 }  }
   
Line 768 
Line 772 
         status_message_clear(c);          status_message_clear(c);
         status_prompt_clear(c);          status_prompt_clear(c);
   
         c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,          c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0);
             time(NULL), 0);  
   
         c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,          c->prompt_buffer = status_replace(c, NULL, input, time(NULL), 0);
             time(NULL), 0);  
         c->prompt_index = strlen(c->prompt_buffer);          c->prompt_index = strlen(c->prompt_buffer);
   
         c->prompt_callbackfn = callbackfn;          c->prompt_callbackfn = callbackfn;
Line 820 
Line 822 
 status_prompt_update(struct client *c, const char *msg, const char *input)  status_prompt_update(struct client *c, const char *msg, const char *input)
 {  {
         free(c->prompt_string);          free(c->prompt_string);
         c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,          c->prompt_string = status_replace(c, NULL, msg, time(NULL), 0);
             time(NULL), 0);  
   
         free(c->prompt_buffer);          free(c->prompt_buffer);
         c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,          c->prompt_buffer = status_replace(c, NULL, input, time(NULL), 0);
             time(NULL), 0);  
         c->prompt_index = strlen(c->prompt_buffer);          c->prompt_index = strlen(c->prompt_buffer);
   
         c->prompt_hindex = 0;          c->prompt_hindex = 0;

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120