[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.54 and 1.55

version 1.54, 2009/12/03 17:44:02 version 1.55, 2009/12/03 22:50:10
Line 37 
Line 37 
 void    status_job_callback(struct job *);  void    status_job_callback(struct job *);
 size_t  status_width(struct client *, struct winlink *, time_t);  size_t  status_width(struct client *, struct winlink *, time_t);
 char   *status_print(  char   *status_print(
             struct client *, struct winlink *, time_t, struct grid_cell *);              struct client *, struct winlink *, time_t, struct grid_cell *);
 void    status_replace1(struct client *,  void    status_replace1(struct client *,
             struct winlink *, char **, char **, char *, size_t, int);              struct winlink *, char **, char **, char *, size_t, int);
 void    status_message_callback(int, short, void *);  void    status_message_callback(int, short, void *);
   
 void    status_prompt_add_history(struct client *);  void    status_prompt_add_history(struct client *);
Line 163 
Line 163 
          * Figure out how much space we have for the window list. If there           * Figure out how much space we have for the window list. If there
          * isn't enough space, just show a blank status line.           * isn't enough space, just show a blank status line.
          */           */
         needed = 0;          needed = 0;
         if (llen != 0)          if (llen != 0)
                 needed += llen + 1;                  needed += llen + 1;
         if (rlen != 0)          if (rlen != 0)
Line 179 
Line 179 
                         xfree(wl->status_text);                          xfree(wl->status_text);
                 memcpy(&wl->status_cell, &stdgc, sizeof wl->status_cell);                  memcpy(&wl->status_cell, &stdgc, sizeof wl->status_cell);
                 wl->status_text = status_print(c, wl, t, &wl->status_cell);                  wl->status_text = status_print(c, wl, t, &wl->status_cell);
                 wl->status_width =                  wl->status_width =
                     screen_write_cstrlen(utf8flag, "%s", wl->status_text);                      screen_write_cstrlen(utf8flag, "%s", wl->status_text);
   
                 if (wl == s->curw)                  if (wl == s->curw)
Line 193 
Line 193 
         /* And draw the window list into it. */          /* And draw the window list into it. */
         screen_write_start(&ctx, NULL, &window_list);          screen_write_start(&ctx, NULL, &window_list);
         RB_FOREACH(wl, winlinks, &s->windows) {          RB_FOREACH(wl, winlinks, &s->windows) {
                 screen_write_cnputs(&ctx,                  screen_write_cnputs(&ctx,
                     -1, &wl->status_cell, utf8flag, "%s", wl->status_text);                      -1, &wl->status_cell, utf8flag, "%s", wl->status_text);
                 screen_write_putc(&ctx, &stdgc, ' ');                  screen_write_putc(&ctx, &stdgc, ' ');
         }          }
Line 227 
Line 227 
                         larrow = 1;                          larrow = 1;
                         wlavailable--;                          wlavailable--;
                 }                  }
   
                 wlstart = wloffset + wlsize - wlavailable;                  wlstart = wloffset + wlsize - wlavailable;
                 if (wlavailable > 0 && wlwidth > wlstart + wlavailable + 1) {                  if (wlavailable > 0 && wlwidth > wlstart + wlavailable + 1) {
                         rarrow = 1;                          rarrow = 1;
Line 271 
Line 271 
         }          }
   
 draw:  draw:
         /* Begin drawing. */          /* Begin drawing. */
         screen_write_start(&ctx, NULL, &c->status);          screen_write_start(&ctx, NULL, &c->status);
   
         /* Draw the left string and arrow. */          /* Draw the left string and arrow. */
Line 320 
Line 320 
         /* Copy the window list. */          /* Copy the window list. */
         screen_write_cursormove(&ctx, wloffset, 0);          screen_write_cursormove(&ctx, wloffset, 0);
         screen_write_copy(&ctx, &window_list, wlstart, 0, wlwidth, 1);          screen_write_copy(&ctx, &window_list, wlstart, 0, wlwidth, 1);
         screen_free(&window_list);          screen_free(&window_list);
   
         screen_write_stop(&ctx);          screen_write_stop(&ctx);
   
Line 355 
Line 355 
         limit = strtol(*iptr, &endptr, 10);          limit = strtol(*iptr, &endptr, 10);
         if ((limit == 0 && errno != EINVAL) ||          if ((limit == 0 && errno != EINVAL) ||
             (limit == LONG_MIN && errno != ERANGE) ||              (limit == LONG_MIN && errno != ERANGE) ||
             (limit == LONG_MAX && errno != ERANGE) ||              (limit == LONG_MAX && errno != ERANGE) ||
             limit != 0)              limit != 0)
                 *iptr = endptr;                  *iptr = endptr;
         if (limit <= 0)          if (limit <= 0)
Line 412 
Line 412 
                 ptr = tmp;                  ptr = tmp;
                 goto do_replace;                  goto do_replace;
         case '[':          case '[':
                 /*                  /*
                  * Embedded style, handled at display time. Leave present and                   * Embedded style, handled at display time. Leave present and
                  * skip input until ].                   * skip input until ].
                  */                   */
Line 424 
Line 424 
         }          }
   
         return;          return;
   
 do_replace:  do_replace:
         ptrlen = strlen(ptr);          ptrlen = strlen(ptr);
         if ((size_t) limit < ptrlen)          if ((size_t) limit < ptrlen)
Line 779 
Line 779 
 void  void
 status_prompt_clear(struct client *c)  status_prompt_clear(struct client *c)
 {  {
         if (c->prompt_string == NULL)          if (c->prompt_string == NULL)
                 return;                  return;
   
         if (c->prompt_freefn != NULL && c->prompt_data != NULL)          if (c->prompt_freefn != NULL && c->prompt_data != NULL)
Line 857 
Line 857 
                 screen_write_nputs(                  screen_write_nputs(
                     &ctx, left, &gc, utf8flag, "%s", c->prompt_buffer + off);                      &ctx, left, &gc, utf8flag, "%s", c->prompt_buffer + off);
   
                 for (i = len + size; i < c->tty.sx; i++)                  for (i = len + size; i < c->tty.sx; i++)
                         screen_write_putc(&ctx, &gc, ' ');                          screen_write_putc(&ctx, &gc, ' ');
         }          }
   
         screen_write_stop(&ctx);          screen_write_stop(&ctx);
Line 949 
Line 949 
                 size -= last - first;                  size -= last - first;
   
                 /* Insert the new word. */                  /* Insert the new word. */
                 size += strlen(s);                  size += strlen(s);
                 off = first - c->prompt_buffer;                  off = first - c->prompt_buffer;
                 c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1);                  c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1);
                 first = c->prompt_buffer + off;                  first = c->prompt_buffer + off;
                 memmove(first + strlen(s), first, n);                  memmove(first + strlen(s), first, n);
                 memcpy(first, s, strlen(s));                  memcpy(first, s, strlen(s));
   
                 c->prompt_index = (first - c->prompt_buffer) + strlen(s);                  c->prompt_index = (first - c->prompt_buffer) + strlen(s);
                 xfree(s);                  xfree(s);
Line 974 
Line 974 
                         c->flags |= CLIENT_STATUS;                          c->flags |= CLIENT_STATUS;
                 }                  }
                 break;                  break;
         case MODEKEYEDIT_DELETE:          case MODEKEYEDIT_DELETE:
                 if (c->prompt_index != size) {                  if (c->prompt_index != size) {
                         memmove(c->prompt_buffer + c->prompt_index,                          memmove(c->prompt_buffer + c->prompt_index,
                             c->prompt_buffer + c->prompt_index + 1,                              c->prompt_buffer + c->prompt_index + 1,
Line 1056 
Line 1056 
                         c->flags |= CLIENT_STATUS;                          c->flags |= CLIENT_STATUS;
                 }                  }
                 break;                  break;
         case MODEKEYEDIT_ENTER:          case MODEKEYEDIT_ENTER:
                 if (*c->prompt_buffer != '\0')                  if (*c->prompt_buffer != '\0')
                         status_prompt_add_history(c);                          status_prompt_add_history(c);
                 if (c->prompt_callbackfn(c->prompt_data, c->prompt_buffer) == 0)                  if (c->prompt_callbackfn(c->prompt_data, c->prompt_buffer) == 0)

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55