diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-12 20:05:05 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-12 20:05:05 +0100 |
| commit | e0b157f56694a5b5e535083c8fc0bc0e1194c9dc (patch) | |
| tree | 2beb33ea2397ae4ad091a12642a4f772e67c23ac /vis-modes.c | |
| parent | 49fffba7d02d116bbfffb5244aa17df6c2cdcbd2 (diff) | |
| download | vis-e0b157f56694a5b5e535083c8fc0bc0e1194c9dc.tar.gz vis-e0b157f56694a5b5e535083c8fc0bc0e1194c9dc.tar.xz | |
vis: respect window local mappings for child modes
Since commit 197ab824206335eab7ceed774ddeccac18fafc09 visual line
and replace modes are child modes, hence we also have to consider
the window local key bindings of their respective parent modes.
For example in replace mode the key lookup chain is now as follows:
window local replace mode -> global replace mode ->
window local insert mode -> global insert mode
This fixes <Enter> behaviour in prompt for replace and visual line
modes.
Diffstat (limited to 'vis-modes.c')
| -rw-r--r-- | vis-modes.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vis-modes.c b/vis-modes.c index 858e427..f519b5b 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -140,16 +140,19 @@ static void vis_mode_replace_input(Vis *vis, const char *str, size_t len) { Mode vis_modes[] = { [VIS_MODE_OPERATOR_PENDING] = { + .id = VIS_MODE_OPERATOR_PENDING, .name = "OPERATOR-PENDING", .input = vis_mode_operator_input, .help = "", }, [VIS_MODE_NORMAL] = { + .id = VIS_MODE_NORMAL, .name = "NORMAL", .status = "", .help = "", }, [VIS_MODE_VISUAL] = { + .id = VIS_MODE_VISUAL, .name = "VISUAL", .status = "--VISUAL--", .help = "", @@ -158,6 +161,7 @@ Mode vis_modes[] = { .visual = true, }, [VIS_MODE_VISUAL_LINE] = { + .id = VIS_MODE_VISUAL_LINE, .name = "VISUAL LINE", .parent = &vis_modes[VIS_MODE_VISUAL], .status = "--VISUAL LINE--", @@ -167,6 +171,7 @@ Mode vis_modes[] = { .visual = true, }, [VIS_MODE_INSERT] = { + .id = VIS_MODE_INSERT, .name = "INSERT", .status = "--INSERT--", .help = "", @@ -177,6 +182,7 @@ Mode vis_modes[] = { .idle_timeout = 3, }, [VIS_MODE_REPLACE] = { + .id = VIS_MODE_REPLACE, .name = "REPLACE", .parent = &vis_modes[VIS_MODE_INSERT], .status = "--REPLACE--", |
