diff options
Diffstat (limited to 'vis-modes.c')
| -rw-r--r-- | vis-modes.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/vis-modes.c b/vis-modes.c index a10d214..7008161 100644 --- a/vis-modes.c +++ b/vis-modes.c @@ -132,10 +132,11 @@ static void vis_mode_insert_enter(Vis *vis, Mode *old) { } static void vis_mode_insert_leave(Vis *vis, Mode *new) { - /* make sure we can recover the current state after an editing operation */ - text_snapshot(vis->win->file->text); - if (new == mode_get(vis, VIS_MODE_NORMAL)) + if (new == mode_get(vis, VIS_MODE_NORMAL)) { + /* make sure we can recover the current state after an editing operation */ + text_snapshot(vis->win->file->text); macro_operator_stop(vis); + } } static void vis_mode_insert_idle(Vis *vis) { @@ -161,10 +162,11 @@ static void vis_mode_replace_enter(Vis *vis, Mode *old) { } static void vis_mode_replace_leave(Vis *vis, Mode *new) { - /* make sure we can recover the current state after an editing operation */ - text_snapshot(vis->win->file->text); - if (new == mode_get(vis, VIS_MODE_NORMAL)) + if (new == mode_get(vis, VIS_MODE_NORMAL)) { + /* make sure we can recover the current state after an editing operation */ + text_snapshot(vis->win->file->text); macro_operator_stop(vis); + } } static void vis_mode_replace_input(Vis *vis, const char *str, size_t len) { |
