diff options
| -rw-r--r-- | config.def.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index b8bbdd5..ad8eb4c 100644 --- a/config.def.h +++ b/config.def.h @@ -453,6 +453,11 @@ static KeyBinding vis_insert_mode[] = { { /* empty last element, array terminator */ }, }; +static void vis_mode_insert_leave(Mode *old) { + /* make sure we can recover the current state after an editing operation */ + text_snapshot(vis->win->text); +} + static void vis_insert_idle(void) { text_snapshot(vis->win->text); } @@ -466,6 +471,11 @@ static KeyBinding vis_replace[] = { { /* empty last element, array terminator */ }, }; +static void vis_mode_replace_leave(Mode *old) { + /* make sure we can recover the current state after an editing operation */ + text_snapshot(vis->win->text); +} + static void vis_replace_input(const char *str, size_t len) { editor_replace_key(vis, str, len); } @@ -603,6 +613,7 @@ static Mode vis_modes[] = { .name = "INSERT", .parent = &vis_modes[VIS_MODE_INSERT_REGISTER], .bindings = vis_insert_mode, + .leave = vis_mode_insert_leave, .input = vis_insert_input, .idle = vis_insert_idle, }, @@ -610,6 +621,7 @@ static Mode vis_modes[] = { .name = "REPLACE", .parent = &vis_modes[VIS_MODE_INSERT], .bindings = vis_replace, + .leave = vis_mode_replace_leave, .input = vis_replace_input, .idle = vis_insert_idle, }, |
