1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[kbdbind] Assign values to default_keybinding every time. Refs #152

This commit is contained in:
Witold Filipczyk 2022-04-23 19:42:15 +02:00
parent b9a648059b
commit 77c98ab2a4

View File

@ -807,15 +807,13 @@ static struct default_kb *default_keybindings[] = {
static int static int
keybinding_is_default(struct keybinding *keybinding) keybinding_is_default(struct keybinding *keybinding)
{ {
static struct default_kb default_keybinding = { static struct default_kb default_keybinding;
{
keybinding->kbd.key,
keybinding->kbd.modifier
},
keybinding->action_id
};
struct default_kb *pos; struct default_kb *pos;
default_keybinding.kbd.key = keybinding->kbd.key;
default_keybinding.kbd.modifier = keybinding->kbd.modifier;
default_keybinding.action_id = keybinding->action_id;
for (pos = default_keybindings[keybinding->keymap_id]; pos->kbd.key; pos++) for (pos = default_keybindings[keybinding->keymap_id]; pos->kbd.key; pos++)
if (!memcmp(&default_keybinding, pos, sizeof(default_keybinding))) if (!memcmp(&default_keybinding, pos, sizeof(default_keybinding)))
return 1; return 1;