[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.3 and 1.4

version 1.3, 2009/07/21 22:41:00 version 1.4, 2009/07/24 14:52:47
Line 46 
Line 46 
 {  {
         struct key_binding      *bd;          struct key_binding      *bd;
         const char              *key;          const char              *key;
         char                     tmp[BUFSIZ];          char                     tmp[BUFSIZ], keytmp[64];
         int                      width, keywidth;          int                      width, keywidth;
   
         width = 0;          width = 0;
         SPLAY_FOREACH(bd, key_bindings, &key_bindings) {          SPLAY_FOREACH(bd, key_bindings, &key_bindings) {
                 if ((key = key_string_lookup_key(bd->key)) == NULL)                  key = key_string_lookup_key(bd->key & ~KEYC_PREFIX);
                   if (key == NULL)
                         continue;                          continue;
   
                 keywidth = strlen(key) + 1;                  keywidth = strlen(key) + 1;
                   if (!(bd->key & KEYC_PREFIX))
                           keywidth += 2;
                 if (keywidth > width)                  if (keywidth > width)
                         width = keywidth;                          width = keywidth;
         }          }
   
   
         SPLAY_FOREACH(bd, key_bindings, &key_bindings) {          SPLAY_FOREACH(bd, key_bindings, &key_bindings) {
                 if ((key = key_string_lookup_key(bd->key)) == NULL)                  key = key_string_lookup_key(bd->key & ~KEYC_PREFIX);
                   if (key == NULL)
                         continue;                          continue;
   
                 *tmp = '\0';                  *tmp = '\0';
                 cmd_list_print(bd->cmdlist, tmp, sizeof tmp);                  cmd_list_print(bd->cmdlist, tmp, sizeof tmp);
                   if (!(bd->key & KEYC_PREFIX)) {
                           xsnprintf(keytmp, sizeof keytmp, "[%s]", key);
                           key = keytmp;
                   }
                 ctx->print(ctx, "%*s: %s", width, key, tmp);                  ctx->print(ctx, "%*s: %s", width, key, tmp);
         }          }
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4