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

Diff for /src/usr.bin/tmux/cmd-list-keys.c between version 1.64 and 1.65

version 1.64, 2021/08/20 17:50:42 version 1.65, 2021/08/20 19:50:16
Line 150 
Line 150 
         struct args             *args = cmd_get_args(self);          struct args             *args = cmd_get_args(self);
         struct key_table        *table;          struct key_table        *table;
         struct key_binding      *bd;          struct key_binding      *bd;
         const char              *tablename, *r;          const char              *tablename, *r, *keystr;
         char                    *key, *cp, *tmp, *start, *empty;          char                    *key, *cp, *tmp, *start, *empty;
         key_code                 prefix, only = KEYC_UNKNOWN;          key_code                 prefix, only = KEYC_UNKNOWN;
         int                      repeat, width, tablewidth, keywidth, found = 0;          int                      repeat, width, tablewidth, keywidth, found = 0;
Line 159 
Line 159 
         if (cmd_get_entry(self) == &cmd_list_commands_entry)          if (cmd_get_entry(self) == &cmd_list_commands_entry)
                 return (cmd_list_keys_commands(self, item));                  return (cmd_list_keys_commands(self, item));
   
         if (args->argc != 0) {          if ((keystr = args_string(args, 0)) != NULL) {
                 only = key_string_lookup_string(args->argv[0]);                  only = key_string_lookup_string(keystr);
                 if (only == KEYC_UNKNOWN) {                  if (only == KEYC_UNKNOWN) {
                         cmdq_error(item, "invalid key: %s", args->argv[0]);                          cmdq_error(item, "invalid key: %s", keystr);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
                 only &= (KEYC_MASK_KEY|KEYC_MASK_MODIFIERS);                  only &= (KEYC_MASK_KEY|KEYC_MASK_MODIFIERS);
Line 243 
Line 243 
   
         tmpsize = 256;          tmpsize = 256;
         tmp = xmalloc(tmpsize);          tmp = xmalloc(tmpsize);
   
         table = key_bindings_first_table();          table = key_bindings_first_table();
         while (table != NULL) {          while (table != NULL) {
                 if (tablename != NULL && strcmp(table->name, tablename) != 0) {                  if (tablename != NULL && strcmp(table->name, tablename) != 0) {
Line 307 
Line 308 
   
 out:  out:
         if (only != KEYC_UNKNOWN && !found) {          if (only != KEYC_UNKNOWN && !found) {
                 cmdq_error(item, "unknown key: %s", args->argv[0]);                  cmdq_error(item, "unknown key: %s", args_string(args, 0));
                 return (CMD_RETURN_ERROR);                  return (CMD_RETURN_ERROR);
         }          }
         return (CMD_RETURN_NORMAL);          return (CMD_RETURN_NORMAL);
Line 320 
Line 321 
         const struct cmd_entry  **entryp;          const struct cmd_entry  **entryp;
         const struct cmd_entry   *entry;          const struct cmd_entry   *entry;
         struct format_tree       *ft;          struct format_tree       *ft;
         const char               *template, *s, *command = NULL;          const char               *template, *s, *command;
         char                     *line;          char                     *line;
   
         if (args->argc != 0)  
                 command = args->argv[0];  
   
         if ((template = args_get(args, 'F')) == NULL) {          if ((template = args_get(args, 'F')) == NULL) {
                 template = "#{command_list_name}"                  template = "#{command_list_name}"
                     "#{?command_list_alias, (#{command_list_alias}),} "                      "#{?command_list_alias, (#{command_list_alias}),} "
Line 335 
Line 333 
         ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0);          ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0);
         format_defaults(ft, NULL, NULL, NULL, NULL);          format_defaults(ft, NULL, NULL, NULL, NULL);
   
           command = args_string(args, 0);
         for (entryp = cmd_table; *entryp != NULL; entryp++) {          for (entryp = cmd_table; *entryp != NULL; entryp++) {
                 entry = *entryp;                  entry = *entryp;
                 if (command != NULL &&                  if (command != NULL &&

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65