summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 002dfe5)
raw | patch | inline | side by side (parent: 002dfe5)
author | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Apr 2010 02:34:12 +0000 (22:34 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 22 Apr 2010 02:35:28 +0000 (22:35 -0400) |
... and then overwrite it with the new request.
tig.c | patch | blob | history |
index 7eb9f71b6827036fea61d811fedd0296d0a7dc28..0c57533fb7c9319315b5cd675083c31ea09c0bfc 100644 (file)
--- a/tig.c
+++ b/tig.c
add_keybinding(enum keymap keymap, enum request request, int key)
{
struct keybinding_table *table = &keybindings[keymap];
+ size_t i;
+
+ for (i = 0; i < keybindings[keymap].size; i++) {
+ if (keybindings[keymap].data[i].alias == key) {
+ keybindings[keymap].data[i].request = request;
+ return;
+ }
+ }
table->data = realloc(table->data, (table->size + 1) * sizeof(*table->data));
if (!table->data)