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

Diff for /src/usr.bin/tmux/Attic/window-choose.c between version 1.19 and 1.20

version 1.19, 2012/06/25 14:08:55 version 1.20, 2012/06/25 14:27:25
Line 133 
Line 133 
         wcd = xmalloc(sizeof *wcd);          wcd = xmalloc(sizeof *wcd);
         wcd->ft = format_create();          wcd->ft = format_create();
         wcd->ft_template = NULL;          wcd->ft_template = NULL;
         wcd->action = NULL;          wcd->command = NULL;
         wcd->raw_format = NULL;  
         wcd->client = ctx->curclient;          wcd->client = ctx->curclient;
         wcd->session = ctx->curclient->session;          wcd->session = ctx->curclient->session;
         wcd->idx = -1;          wcd->idx = -1;
Line 482 
Line 481 
 {  {
         struct cmd_ctx           ctx;          struct cmd_ctx           ctx;
         struct cmd_list         *cmdlist;          struct cmd_list         *cmdlist;
         char                    *template, *cause;          char                    *cause;
   
         template = cmd_template_replace(cdata->action,          /* The command template will have already been replaced.  But if it's
                         cdata->raw_format, 1);           * NULL, bail here.
            */
           if (cdata->command == NULL)
                   return;
   
         if (cmd_string_parse(template, &cmdlist, &cause) != 0) {          if (cmd_string_parse(cdata->command, &cmdlist, &cause) != 0) {
                 if (cause != NULL) {                  if (cause != NULL) {
                         *cause = toupper((u_char) *cause);                          *cause = toupper((u_char) *cause);
                         status_message_set(cdata->client, "%s", cause);                          status_message_set(cdata->client, "%s", cause);
                         xfree(cause);                          xfree(cause);
                 }                  }
                 xfree(template);  
                 return;                  return;
         }          }
         xfree(template);  
   
         ctx.msgdata = NULL;          ctx.msgdata = NULL;
         ctx.curclient = cdata->client;          ctx.curclient = cdata->client;
Line 509 
Line 509 
   
         cmd_list_exec(cmdlist, &ctx);          cmd_list_exec(cmdlist, &ctx);
         cmd_list_free(cmdlist);          cmd_list_free(cmdlist);
   }
   
   struct window_choose_data *
   window_choose_add_session(struct window_pane *wp, struct cmd_ctx *ctx,
           struct session *s, const char *template, char *action, u_int idx)
   {
           struct window_choose_data       *wcd;
   
           wcd = window_choose_data_create(ctx);
           wcd->idx = s->idx;
           wcd->command = cmd_template_replace(action, s->name, 1);
           wcd->ft_template = xstrdup(template);
           format_add(wcd->ft, "line", "%u", idx);
           format_session(wcd->ft, s);
   
           wcd->client->references++;
           wcd->session->references++;
   
           window_choose_add(wp, wcd);
   
           return (wcd);
   }
   
   struct window_choose_data *
   window_choose_add_window(struct window_pane *wp, struct cmd_ctx *ctx,
           struct session *s, struct winlink *wl, const char *template,
           char *action, u_int idx)
   {
           struct window_choose_data       *wcd;
           char                            *action_data;
   
           wcd = window_choose_data_create(ctx);
   
           xasprintf(&action_data, "%s:%d", s->name, wl->idx);
           wcd->command = cmd_template_replace(action, action_data, 1);
           xfree(action_data);
   
           wcd->idx = wl->idx;
           wcd->ft_template = xstrdup(template);
           format_add(wcd->ft, "line", "%u", idx);
           format_session(wcd->ft, s);
           format_winlink(wcd->ft, s, wl);
           format_window_pane(wcd->ft, wl->window->active);
   
           wcd->client->references++;
           wcd->session->references++;
   
           window_choose_add(wp, wcd);
   
           return (wcd);
 }  }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20