Rework key binding context switching

Store key binding contexts using another data structure to optimize
space usage and execution time.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2014-07-17 21:08:55 +02:00
parent 8f28b8f9cc
commit 76563c9b90
5 changed files with 133 additions and 143 deletions

View File

@@ -775,11 +775,9 @@ static void config_option_edit(int i)
/* Notify-bar configuration. */
void notify_config_bar(void)
{
struct binding quit = { _("Quit"), KEY_GENERIC_QUIT };
struct binding up = { _("Up"), KEY_MOVE_UP };
struct binding down = { _("Down"), KEY_MOVE_DOWN };
struct binding edit = { _("Edit Itm"), KEY_EDIT_ITEM };
struct binding *bindings[] = { &quit, &up, &down, &edit };
static int bindings[] = {
KEY_GENERIC_QUIT, KEY_MOVE_UP, KEY_MOVE_DOWN, KEY_EDIT_ITEM
};
struct listbox lb;
int ch;