From 197ab824206335eab7ceed774ddeccac18fafc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 10 Feb 2016 22:23:24 +0100 Subject: vis: simplify modes implementation Make replace mode a child of insert mode and visual line a child of visual mode. This means any key binding for the former is automatically available in the latter. Also keys can not be unmapped solely from the child modes. --- vis.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 42bc0a0..96ee002 100644 --- a/vis.c +++ b/vis.c @@ -662,6 +662,8 @@ static const char *vis_keys_raw(Vis *vis, Buffer *buf, const char *input) { } for (; mode && !binding && !prefix; mode = mode->parent) { + if (!mode->bindings) + continue; binding = map_get(mode->bindings, start); /* "<" is never treated as a prefix because it is used to denote * special key symbols */ -- cgit v1.2.3