[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.7 and 1.8

version 1.7, 2009/07/28 17:05:10 version 1.8, 2009/11/05 12:04:50
Line 47 
Line 47 
         struct cmd_target_data  *data = self->data;          struct cmd_target_data  *data = self->data;
         struct key_binding      *bd;          struct key_binding      *bd;
         const char              *key;          const char              *key;
         char                     tmp[BUFSIZ], keytmp[64];          char                     tmp[BUFSIZ];
           size_t                   used;
         int                      width, keywidth;          int                      width, keywidth;
   
         if (data->target != NULL)          if (data->target != NULL)
Line 70 
Line 71 
                 key = key_string_lookup_key(bd->key & ~KEYC_PREFIX);                  key = key_string_lookup_key(bd->key & ~KEYC_PREFIX);
                 if (key == NULL)                  if (key == NULL)
                         continue;                          continue;
                   if (!(bd->key & KEYC_PREFIX))
                           used = xsnprintf(tmp, sizeof tmp, "[%s]: ", key);
                   else
                           used = xsnprintf(tmp, sizeof tmp, "%*s: ", width, key);
                   if (used >= sizeof tmp)
                           continue;
   
                 *tmp = '\0';                  cmd_list_print(bd->cmdlist, tmp + used, (sizeof tmp) - used);
                 cmd_list_print(bd->cmdlist, tmp, sizeof tmp);                  ctx->print(ctx, "%s", tmp);
                 if (!(bd->key & KEYC_PREFIX)) {  
                         xsnprintf(keytmp, sizeof keytmp, "[%s]", key);  
                         key = keytmp;  
                 }  
                 ctx->print(ctx, "%*s: %s", width, key, tmp);  
         }          }
   
         return (0);          return (0);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8