[BACK]Return to cmd-choose-buffer.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/Attic/cmd-choose-buffer.c between version 1.4 and 1.5

version 1.4, 2011/01/04 00:42:46 version 1.5, 2012/05/22 11:35:37
Line 33 
Line 33 
   
 const struct cmd_entry cmd_choose_buffer_entry = {  const struct cmd_entry cmd_choose_buffer_entry = {
         "choose-buffer", NULL,          "choose-buffer", NULL,
         "t:", 0, 1,          "F:t:", 0, 1,
         CMD_TARGET_WINDOW_USAGE " [template]",          CMD_TARGET_WINDOW_USAGE " [-F format] [template]",
         0,          0,
         NULL,          NULL,
         NULL,          NULL,
Line 53 
Line 53 
         struct cmd_choose_buffer_data   *cdata;          struct cmd_choose_buffer_data   *cdata;
         struct winlink                  *wl;          struct winlink                  *wl;
         struct paste_buffer             *pb;          struct paste_buffer             *pb;
           struct format_tree              *ft;
         u_int                            idx;          u_int                            idx;
         char                            *tmp;          char                            *line;
           const char                      *template;
   
         if (ctx->curclient == NULL) {          if (ctx->curclient == NULL) {
                 ctx->error(ctx, "must be run interactively");                  ctx->error(ctx, "must be run interactively");
                 return (-1);                  return (-1);
         }          }
   
           if ((template = args_get(args, 'F')) == NULL)
                   template = DEFAULT_BUFFER_LIST_TEMPLATE;
   
         if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)          if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL)
                 return (-1);                  return (-1);
   
Line 72 
Line 77 
   
         idx = 0;          idx = 0;
         while ((pb = paste_walk_stack(&global_buffers, &idx)) != NULL) {          while ((pb = paste_walk_stack(&global_buffers, &idx)) != NULL) {
                 tmp = paste_print(pb, 50);                  ft = format_create();
                 window_choose_add(wl->window->active, idx - 1,                  format_add(ft, "line", "%u", idx - 1);
                     "%u: %zu bytes: \"%s\"", idx - 1, pb->size, tmp);                  format_paste_buffer(ft, pb);
                 xfree(tmp);  
                   line = format_expand(ft, template);
                   window_choose_add(wl->window->active, idx - 1, "%s", line);
   
                   xfree(line);
                   format_free(ft);
         }          }
   
         cdata = xmalloc(sizeof *cdata);          cdata = xmalloc(sizeof *cdata);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5