[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.45 and 1.46

version 1.45, 2018/08/02 11:44:07 version 1.46, 2019/05/23 14:03:44
Line 60 
Line 60 
         struct args             *args = self->args;          struct args             *args = self->args;
         struct key_table        *table;          struct key_table        *table;
         struct key_binding      *bd;          struct key_binding      *bd;
         const char              *key, *tablename, *r;          const char              *tablename, *r;
         char                    *cp, tmp[BUFSIZ];          char                    *key, *cp, tmp[BUFSIZ];
         int                      repeat, width, tablewidth, keywidth;          int                      repeat, width, tablewidth, keywidth;
   
         if (self->entry == &cmd_list_commands_entry)          if (self->entry == &cmd_list_commands_entry)
Line 83 
Line 83 
                 }                  }
                 bd = key_bindings_first(table);                  bd = key_bindings_first(table);
                 while (bd != NULL) {                  while (bd != NULL) {
                         key = key_string_lookup_key(bd->key);                          key = args_escape(key_string_lookup_key(bd->key));
   
                         if (bd->flags & KEY_BINDING_REPEAT)                          if (bd->flags & KEY_BINDING_REPEAT)
                                 repeat = 1;                                  repeat = 1;
Line 95 
Line 95 
                         if (width > keywidth)                          if (width > keywidth)
                                 keywidth = width;                                  keywidth = width;
   
                           free(key);
                         bd = key_bindings_next(table, bd);                          bd = key_bindings_next(table, bd);
                 }                  }
                 table = key_bindings_next_table(table);                  table = key_bindings_next_table(table);
Line 108 
Line 109 
                 }                  }
                 bd = key_bindings_first(table);                  bd = key_bindings_first(table);
                 while (bd != NULL) {                  while (bd != NULL) {
                         key = key_string_lookup_key(bd->key);                          key = args_escape(key_string_lookup_key(bd->key));
   
                         if (!repeat)                          if (!repeat)
                                 r = "";                                  r = "";
Line 128 
Line 129 
                         strlcat(tmp, " ", sizeof tmp);                          strlcat(tmp, " ", sizeof tmp);
                         free(cp);                          free(cp);
   
                         cp = cmd_list_print(bd->cmdlist);                          cp = cmd_list_print(bd->cmdlist, 1);
                         strlcat(tmp, cp, sizeof tmp);                          strlcat(tmp, cp, sizeof tmp);
                         free(cp);                          free(cp);
   
                         cmdq_print(item, "bind-key %s", tmp);                          cmdq_print(item, "bind-key %s", tmp);
   
                           free(key);
                         bd = key_bindings_next(table, bd);                          bd = key_bindings_next(table, bd);
                 }                  }
                 table = key_bindings_next_table(table);                  table = key_bindings_next_table(table);

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46