aboutsummaryrefslogtreecommitdiff
path: root/vis-modes.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-modes.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-modes.c')
-rw-r--r--vis-modes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vis-modes.c b/vis-modes.c
index d7784e2..858e427 100644
--- a/vis-modes.c
+++ b/vis-modes.c
@@ -159,6 +159,7 @@ Mode vis_modes[] = {
},
[VIS_MODE_VISUAL_LINE] = {
.name = "VISUAL LINE",
+ .parent = &vis_modes[VIS_MODE_VISUAL],
.status = "--VISUAL LINE--",
.help = "",
.enter = vis_mode_visual_line_enter,
@@ -177,6 +178,7 @@ Mode vis_modes[] = {
},
[VIS_MODE_REPLACE] = {
.name = "REPLACE",
+ .parent = &vis_modes[VIS_MODE_INSERT],
.status = "--REPLACE--",
.help = "",
.enter = vis_mode_replace_enter,