aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h8
-rw-r--r--vis-modes.c2
-rw-r--r--vis-prompt.c2
-rw-r--r--vis.c2
4 files changed, 4 insertions, 10 deletions
diff --git a/config.def.h b/config.def.h
index 774871b..5d53e41 100644
--- a/config.def.h
+++ b/config.def.h
@@ -330,11 +330,6 @@ static const KeyBinding **default_bindings[] = {
},
[VIS_MODE_VISUAL_LINE] = (const KeyBinding*[]){
bindings_visual_line,
- bindings_visual,
- bindings_textobjects,
- bindings_operators,
- bindings_motions,
- bindings_basic,
NULL,
},
[VIS_MODE_INSERT] = (const KeyBinding*[]){
@@ -345,9 +340,6 @@ static const KeyBinding **default_bindings[] = {
},
[VIS_MODE_REPLACE] = (const KeyBinding*[]){
bindings_replace,
- bindings_insert,
- bindings_readline,
- bindings_basic,
NULL,
},
};
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,
diff --git a/vis-prompt.c b/vis-prompt.c
index 2441fa4..ecb07b3 100644
--- a/vis-prompt.c
+++ b/vis-prompt.c
@@ -166,9 +166,7 @@ void vis_prompt_show(Vis *vis, const char *title) {
prompt->parent_mode = vis->mode;
vis_window_mode_map(prompt, VIS_MODE_NORMAL, "<Enter>", &prompt_enter_binding);
vis_window_mode_map(prompt, VIS_MODE_INSERT, "<Enter>", &prompt_enter_binding);
- vis_window_mode_map(prompt, VIS_MODE_REPLACE, "<Enter>", &prompt_enter_binding);
vis_window_mode_map(prompt, VIS_MODE_VISUAL, "<Enter>", &prompt_enter_binding);
- vis_window_mode_map(prompt, VIS_MODE_VISUAL_LINE, "<Enter>", &prompt_enter_binding);
vis_window_mode_map(prompt, VIS_MODE_NORMAL, "<Escape>", &prompt_esc_binding);
vis_window_mode_map(prompt, VIS_MODE_INSERT, "<Up>", &prompt_up_binding);
vis_window_mode_map(prompt, VIS_MODE_INSERT, "<Backspace>", &prompt_backspace_binding);
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 */