There isn't must result here - just a flag to say "yes, a change was made".
But it was being handled completely wrongly!
I think it is fixed now.
Signed-off-by: NeilBrown <neil@brown.name>
char *str, bool *first)
{
struct cmd_info ci = {0};
+ int ret;
+
ci.key = "doc:replace";
ci.focus = p;
ci.mark = m;
ci.str = str;
ci.extra = *first;
ci.numeric = 1;
- key_handle_focus(&ci);
- *first = ci.extra;
+ ret = key_handle_focus(&ci);
+ if (ret == 1)
+ *first = 1;
}
static inline int doc_undo(struct pane *p, bool redo)
{
struct mark *pm = dd->point;
struct mark *end = ci->mark;
char *str = ci->str;
- bool first = ci->numeric;
+ bool first = ci->extra;
struct mark *early = NULL;
/* First delete, then insert */
}
point_notify_change(&t->doc, pm, early);
- ci->numeric = first;
- return 1;
+ return first ? 1 : 2;
}