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

Diff for /src/usr.bin/tmux/key-bindings.c between version 1.60 and 1.61

version 1.60, 2016/10/12 13:03:27 version 1.61, 2016/10/16 17:55:14
Line 377 
Line 377 
         struct cmd_list *cmdlist;          struct cmd_list *cmdlist;
         char            *cause;          char            *cause;
         int              error;          int              error;
         struct cmd_q    *cmdq;  
   
         cmdq = cmdq_new(NULL);  
         for (i = 0; i < nitems(defaults); i++) {          for (i = 0; i < nitems(defaults); i++) {
                 error = cmd_string_parse(defaults[i], &cmdlist,                  error = cmd_string_parse(defaults[i], &cmdlist,
                     "<default-keys>", i, &cause);                      "<default-keys>", i, &cause);
                 if (error != 0)                  if (error != 0)
                         fatalx("bad default key");                          fatalx("bad default key");
                 cmdq_run(cmdq, cmdlist, NULL);                  cmdq_append(NULL, cmdq_get_command(cmdlist, NULL, NULL, 0));
                 cmd_list_free(cmdlist);                  cmd_list_free(cmdlist);
         }          }
         cmdq_free(cmdq);  
 }  }
   
   static enum cmd_retval
   key_bindings_read_only(struct cmd_q *cmdq, __unused void *data)
   {
           cmdq_error(cmdq, "client is read-only");
           return (CMD_RETURN_ERROR);
   }
   
 void  void
 key_bindings_dispatch(struct key_binding *bd, struct client *c,  key_bindings_dispatch(struct key_binding *bd, struct client *c,
     struct mouse_event *m)      struct mouse_event *m)
Line 403 
Line 407 
                 if (!(cmd->entry->flags & CMD_READONLY))                  if (!(cmd->entry->flags & CMD_READONLY))
                         readonly = 0;                          readonly = 0;
         }          }
         if (!readonly && (c->flags & CLIENT_READONLY)) {          if (!readonly && (c->flags & CLIENT_READONLY))
                 cmdq_error(c->cmdq, "client is read-only");                  cmdq_append(c, cmdq_get_callback(key_bindings_read_only, NULL));
                 return;          else
         }                  cmdq_append(c, cmdq_get_command(bd->cmdlist, NULL, m, 0));
   
         cmdq_run(c->cmdq, bd->cmdlist, m);  
 }  }

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61