diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-04 22:44:53 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-04 22:44:53 +0200 |
| commit | bf60ce7d75949a8d6d53473d3b2430c162f5f897 (patch) | |
| tree | 0ade285ba44ee4b0a705898619a5658102a967dd /main.c | |
| parent | 33812921a2294637e4635d5b8426fc47f69a05a5 (diff) | |
| download | vis-bf60ce7d75949a8d6d53473d3b2430c162f5f897.tar.gz vis-bf60ce7d75949a8d6d53473d3b2430c162f5f897.tar.xz | |
Skip modes with common prefix if it does not match
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -103,6 +103,8 @@ static bool keymatch(Key *key0, Key *key1) { static KeyBinding *keybinding(Mode *mode, Key *key0, Key *key1) { for (; mode; mode = mode->parent) { + if (mode->common_prefix && !keymatch(key0, &mode->bindings->key[0])) + continue; for (KeyBinding *kb = mode->bindings; kb && (kb->key[0].code || kb->key[0].str[0]); kb++) { if (keymatch(key0, &kb->key[0]) && (!key1 || keymatch(key1, &kb->key[1]))) return kb; |
