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

Diff for /src/usr.bin/tmux/cmd-bind-key.c between version 1.16 and 1.17

version 1.16, 2013/03/24 09:54:10 version 1.17, 2013/10/10 12:00:18
Line 27 
Line 27 
  * Bind a key to a command, this recurses through cmd_*.   * Bind a key to a command, this recurses through cmd_*.
  */   */
   
 enum cmd_retval  cmd_bind_key_check(struct args *);  
 enum cmd_retval  cmd_bind_key_exec(struct cmd *, struct cmd_q *);  enum cmd_retval  cmd_bind_key_exec(struct cmd *, struct cmd_q *);
   
 enum cmd_retval  cmd_bind_key_table(struct cmd *, struct cmd_q *, int);  enum cmd_retval  cmd_bind_key_table(struct cmd *, struct cmd_q *, int);
Line 38 
Line 37 
         "[-cnr] [-t key-table] key command [arguments]",          "[-cnr] [-t key-table] key command [arguments]",
         0,          0,
         NULL,          NULL,
         cmd_bind_key_check,  
         cmd_bind_key_exec          cmd_bind_key_exec
 };  };
   
 enum cmd_retval  enum cmd_retval
 cmd_bind_key_check(struct args *args)  
 {  
         if (args_has(args, 't')) {  
                 if (args->argc != 2 && args->argc != 3)  
                         return (CMD_RETURN_ERROR);  
         } else {  
                 if (args->argc < 2)  
                         return (CMD_RETURN_ERROR);  
         }  
         return (CMD_RETURN_NORMAL);  
 }  
   
 enum cmd_retval  
 cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)  cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)
 {  {
         struct args     *args = self->args;          struct args     *args = self->args;
         char            *cause;          char            *cause;
         struct cmd_list *cmdlist;          struct cmd_list *cmdlist;
         int              key;          int              key;
   
           if (args_has(args, 't')) {
                   if (args->argc != 2 && args->argc != 3) {
                           cmdq_error(cmdq, "not enough arguments");
                           return (CMD_RETURN_ERROR);
                   }
           } else {
                   if (args->argc < 2) {
                           cmdq_error(cmdq, "not enough arguments");
                           return (CMD_RETURN_ERROR);
                   }
           }
   
         key = key_string_lookup_string(args->argv[0]);          key = key_string_lookup_string(args->argv[0]);
         if (key == KEYC_NONE) {          if (key == KEYC_NONE) {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17