[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.2 and 1.3

version 1.2, 2009/07/13 23:11:35 version 1.3, 2009/07/21 22:41:00
Line 18 
Line 18 
   
 #include <sys/types.h>  #include <sys/types.h>
   
   #include <string.h>
   
 #include "tmux.h"  #include "tmux.h"
   
 /*  /*
Line 45 
Line 47 
         struct key_binding      *bd;          struct key_binding      *bd;
         const char              *key;          const char              *key;
         char                     tmp[BUFSIZ];          char                     tmp[BUFSIZ];
           int                      width, keywidth;
   
           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)                  if ((key = key_string_lookup_key(bd->key)) == NULL)
                         continue;                          continue;
   
                   keywidth = strlen(key) + 1;
                   if (keywidth > width)
                           width = keywidth;
           }
   
   
           SPLAY_FOREACH(bd, key_bindings, &key_bindings) {
                   if ((key = key_string_lookup_key(bd->key)) == NULL)
                           continue;
   
                 *tmp = '\0';                  *tmp = '\0';
                 cmd_list_print(bd->cmdlist, tmp, sizeof tmp);                  cmd_list_print(bd->cmdlist, tmp, sizeof tmp);
                 ctx->print(ctx, "%11s: %s", key, tmp);  
                   ctx->print(ctx, "%*s: %s", width, key, tmp);
         }          }
   
         return (0);          return (0);

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