Skip to content

Commit

Permalink
vis: reject key mappings for which a prefix is already mapped
Browse files Browse the repository at this point in the history
`<` needs a special treatment because it is used to denote symbolic
keys without it the shift left operator would not work.
  • Loading branch information
martanne committed Apr 28, 2016
1 parent eb1e37f commit 53e3c9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vis-modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static bool mode_map(Mode *mode, const char *key, const KeyBinding *binding) {
if (!mode->bindings)
return false;
}
return map_put(mode->bindings, key, binding);
return (strcmp(key, "<") == 0 || !map_contains(mode->bindings, key)) && map_put(mode->bindings, key, binding);
}

bool vis_mode_map(Vis *vis, enum VisMode id, const char *key, const KeyBinding *binding) {
Expand Down

0 comments on commit 53e3c9c

Please sign in to comment.