diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-11-09 11:58:29 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-11-09 12:34:55 +0100 |
| commit | 51bf6abad037a333ad3b8f760150de4d834bb900 (patch) | |
| tree | c2c8d9e5fc4d6f76c310202dfc096ca98f375084 /vis-modes.c | |
| parent | 0e74ee26ef3d441a559ea18bec08018c0c2ef461 (diff) | |
| download | vis-51bf6abad037a333ad3b8f760150de4d834bb900.tar.gz vis-51bf6abad037a333ad3b8f760150de4d834bb900.tar.xz | |
vis: unify VIS_OP_{INSERT,REPLACE} implementation
They both perform a motion before changing mode.
Diffstat (limited to 'vis-modes.c')
| -rw-r--r-- | vis-modes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vis-modes.c b/vis-modes.c index 967feb9..a10d214 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -122,7 +122,8 @@ static void vis_mode_insert_enter(Vis *vis, Mode *old) { return; if (!vis->action.op) { action_reset(&vis->action_prev); - vis->action_prev.op = &vis_operators[VIS_OP_INSERT]; + vis->action_prev.op = &vis_operators[VIS_OP_MODESWITCH]; + vis->action_prev.mode = VIS_MODE_INSERT; } if (!vis->macro_operator) { macro_operator_record(vis); @@ -150,7 +151,8 @@ static void vis_mode_replace_enter(Vis *vis, Mode *old) { return; if (!vis->action.op) { action_reset(&vis->action_prev); - vis->action_prev.op = &vis_operators[VIS_OP_REPLACE]; + vis->action_prev.op = &vis_operators[VIS_OP_MODESWITCH]; + vis->action_prev.mode = VIS_MODE_REPLACE; } if (!vis->macro_operator) { macro_operator_record(vis); |
