From 40a6aedd7a2da02c42e72c636493c27059696947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 20 Feb 2016 17:59:44 +0100 Subject: vis: reject obviously recursive key bindings This does only detect the simplest cases. --- vis-modes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vis-modes.c b/vis-modes.c index f519b5b..177b034 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -1,3 +1,4 @@ +#include #include "vis-core.h" #include "util.h" @@ -27,6 +28,8 @@ void vis_mode_switch(Vis *vis, enum VisMode mode) { static bool mode_map(Mode *mode, const char *key, const KeyBinding *binding) { if (!mode) return false; + if (binding->alias && key[0] != '<' && strncmp(key, binding->alias, strlen(key)) == 0) + return false; if (!mode->bindings) { mode->bindings = map_new(); if (!mode->bindings) -- cgit v1.2.3