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

Diff for /src/usr.bin/tmux/menu.c between version 1.20 and 1.21

version 1.20, 2020/04/13 15:55:51 version 1.21, 2020/04/13 18:59:41
Line 183 
Line 183 
         struct mouse_event              *m = &event->m;          struct mouse_event              *m = &event->m;
         u_int                            i;          u_int                            i;
         int                              count = menu->count, old = md->choice;          int                              count = menu->count, old = md->choice;
         const struct menu_item          *item;  
         struct cmdq_item                *new_item;  
         struct cmdq_state               *new_state;  
         struct cmd_parse_result         *pr;  
         const char                      *name;          const char                      *name;
           const struct menu_item          *item;
           struct cmdq_state               *state;
           enum cmd_parse_status            status;
           char                            *error;
   
         if (KEYC_IS_MOUSE(event->key)) {          if (KEYC_IS_MOUSE(event->key)) {
                 if (md->flags & MENU_NOMOUSE) {                  if (md->flags & MENU_NOMOUSE) {
Line 272 
Line 272 
             return (1);              return (1);
         }          }
   
         pr = cmd_parse_from_string(item->command, NULL);          if (md->item != NULL)
         switch (pr->status) {                  event = cmdq_get_event(md->item);
         case CMD_PARSE_EMPTY:          else
                 break;                  event = NULL;
         case CMD_PARSE_ERROR:          state = cmdq_new_state(&md->fs, event, 0);
                 new_item = cmdq_get_error(pr->error);  
                 free(pr->error);          status = cmd_parse_and_append(item->command, NULL, c, state, &error);
                 cmdq_append(c, new_item);          if (status == CMD_PARSE_ERROR) {
                 break;                  cmdq_append(c, cmdq_get_error(error));
         case CMD_PARSE_SUCCESS:                  free(error);
                 if (md->item != NULL)  
                         event = cmdq_get_event(md->item);  
                 else  
                         event = NULL;  
                 new_state = cmdq_new_state(&md->fs, event, 0);  
                 new_item = cmdq_get_command(pr->cmdlist, new_state);  
                 cmdq_free_state(new_state);  
                 cmd_list_free(pr->cmdlist);  
                 cmdq_append(c, new_item);  
                 break;  
         }          }
           cmdq_free_state(state);
   
         return (1);          return (1);
 }  }
   

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