From 53e3c9cac64bc537963fe12816e905c9726c3cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 28 Apr 2016 20:52:31 +0200 Subject: vis: reject key mappings for which a prefix is already mapped `<` needs a special treatment because it is used to denote symbolic keys without it the shift left operator would not work. --- vis-modes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vis-modes.c b/vis-modes.c index b44212f..62a9541 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -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) { -- cgit v1.2.3