Revamp key bindings display

Refactor the logic inside keys_display_bindings_bar() and remove the
need to place the "show next page" key binding at the right positions.

This used to be a pain to maintain, since we always had to move key
bindings around when introducing a new key. Fix this by passing the
actual key bindings in an array and using a separate parameter for the
"show next page" key binding (which is automatically inserted at the
right places from now on).

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-02-20 06:05:08 +01:00
parent 80d882d03d
commit b5c1981842
4 changed files with 99 additions and 72 deletions

View File

@@ -739,7 +739,8 @@ int keys_action_count_keys (enum key);
char *keys_action_firstkey (enum key);
char *keys_action_nkey (enum key, int);
char *keys_action_allkeys (enum key);
void keys_display_bindings_bar (WINDOW *, struct binding **, int, int);
void keys_display_bindings_bar (WINDOW *, struct binding *[], int, int,
int, struct binding *);
void keys_popup_info (enum key);
void keys_save_bindings (FILE *);
int keys_check_missing_bindings (void);