version 1.2, 2009/07/13 23:11:35 |
version 1.3, 2009/07/21 22:41:00 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
|
#include <string.h> |
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
/* |
/* |
|
|
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); |