On Tue, Jan 27, 2015 at 11:37:42AM -0500, Wolfgang Corcoran-Mathe wrote: > Currently, the replace operator in vis gets lumped with following actions > in the {un,re}do tree. Using the 'r' key several times then attempting > to undo the last replacement undoes the entire series. > > --- > vis.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/vis.c b/vis.c > index 87d6cd1..6112ef1 100644 > --- a/vis.c > +++ b/vis.c > @@ -871,8 +871,8 @@ static void replace(const Arg *arg) { > if (!k.str[0]) > return; > size_t pos = window_cursor_get(vis->win->win); > - action_reset(&action_prev); > - action_prev.op = &ops[OP_REPEAT_REPLACE]; > + action_reset(&action); > + action.op = &ops[OP_REPEAT_REPLACE]; > buffer_put(&buffer_repeat, k.str, strlen(k.str)); > editor_delete_key(vis); > editor_insert_key(vis, k.str, strlen(k.str));
Thanks for the patch! I will fix it by adding an explicit: text_snapshot(vis->win->text); And yes the replace implementation could be improved. Cheers, Marc -- Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0