aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-02-10 22:23:24 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-02-10 22:31:52 +0100
commit197ab824206335eab7ceed774ddeccac18fafc09 (patch)
tree3f31dcbb2b0c2031675c97fb5e6084f115649556 /vis.c
parent66a56c827efcac36e07d6ac34bd05681ab8364e9 (diff)
downloadvis-197ab824206335eab7ceed774ddeccac18fafc09.tar.gz
vis-197ab824206335eab7ceed774ddeccac18fafc09.tar.xz
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.
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c2
1 files changed, 2 insertions, 0 deletions
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 */