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

Diff for /src/usr.bin/tmux/cmd-display-panes.c between version 1.26 and 1.27

version 1.26, 2019/05/20 11:46:06 version 1.27, 2019/05/23 11:13:30
Line 197 
Line 197 
 cmd_display_panes_key(struct client *c, struct key_event *event)  cmd_display_panes_key(struct client *c, struct key_event *event)
 {  {
         struct cmd_display_panes_data   *cdata = c->overlay_data;          struct cmd_display_panes_data   *cdata = c->overlay_data;
         struct cmd_list                 *cmdlist;  
         struct cmdq_item                *new_item;          struct cmdq_item                *new_item;
         char                            *cmd, *expanded, *cause;          char                            *cmd, *expanded;
         struct window                   *w = c->session->curw->window;          struct window                   *w = c->session->curw->window;
         struct window_pane              *wp;          struct window_pane              *wp;
           struct cmd_parse_result         *pr;
   
         if (event->key < '0' || event->key > '9')          if (event->key < '0' || event->key > '9')
                 return (1);                  return (1);
Line 214 
Line 214 
         xasprintf(&expanded, "%%%u", wp->id);          xasprintf(&expanded, "%%%u", wp->id);
         cmd = cmd_template_replace(cdata->command, expanded, 1);          cmd = cmd_template_replace(cdata->command, expanded, 1);
   
         cmdlist = cmd_string_parse(cmd, NULL, 0, &cause);          pr = cmd_parse_from_string(cmd, NULL);
         if (cmdlist == NULL) {          switch (pr->status) {
                 if (cause != NULL)          case CMD_PARSE_EMPTY:
                         new_item = cmdq_get_error(cause);                  new_item = NULL;
                 else                  break;
                         new_item = NULL;          case CMD_PARSE_ERROR:
                 free(cause);                  new_item = cmdq_get_error(pr->error);
         } else {                  free(pr->error);
                 new_item = cmdq_get_command(cmdlist, NULL, NULL, 0);                  cmdq_append(c, new_item);
                 cmd_list_free(cmdlist);                  break;
         }          case CMD_PARSE_SUCCESS:
         if (new_item != NULL) {                  new_item = cmdq_get_command(pr->cmdlist, NULL, NULL, 0);
                 if (cdata->item != NULL)                  cmd_list_free(pr->cmdlist);
                         cmdq_insert_after(cdata->item, new_item);                  cmdq_append(c, new_item);
                 else                  break;
                         cmdq_append(c, new_item);  
         }          }
   
         free(cmd);          free(cmd);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27