In particular: export only one interface.
Signed-off-by: NeilBrown <neil@brown.name>
m = doc_next_mark_all(m))
if (m->ref.p == d->home) {
mark_step2(ed->docs, m, 1, 1);
- doc_notify_change(ed->docs, m);
+ doc_notify_change(ed->docs, m, NULL);
}
}
m = doc_next_mark_all(m))
if (p->siblings.next == &m->ref.p->siblings) {
mark_step2(ed->docs, m, 0, 1);
- doc_notify_change(ed->docs, m);
+ doc_notify_change(ed->docs, m, NULL);
}
}
return NULL;
}
-void point_notify_change(struct doc *d, struct mark *p, struct mark *m)
+static void point_notify_change(struct doc *d, struct mark *p, struct mark *m)
{
/* Notify of changes from m (might be NULL) to p.
* Notify the last mark which is before p or m,
/* doc_notify_change is slower than point_notify_change, but only
* requires a mark, not a point.
+ * A second mark should only be given in the first mark is a point
*/
-void doc_notify_change(struct doc *d, struct mark *m)
+void doc_notify_change(struct doc *d, struct mark *m, struct mark *m2)
{
struct cmd_info ci = {0};
char *done;
int remaining = d->nviews;
if (m->viewnum == MARK_POINT) {
- point_notify_change(d, m, NULL);
+ point_notify_change(d, m, m2);
return;
}
+ ASSERT(m2 == NULL);
done = alloca(d->nviews);
for (i = 0; i < d->nviews; i++)
void __mark_reset(struct doc *d, struct mark *m, int new, int end);
void mark_forward_over(struct mark *m, struct mark *m2);
void mark_backward_over(struct mark *m, struct mark *mp);
-void point_notify_change(struct doc *d, struct mark *p, struct mark *m);
-void doc_notify_change(struct doc *d, struct mark *m);
+void doc_notify_change(struct doc *d, struct mark *m, struct mark *m2);
void doc_check_consistent(struct doc *d);
char *doc_attr(struct pane *dp, struct mark *m, bool forward, char *attr);
char *doc_getstr(struct pane *from, struct mark *to);
list_del(&de->lst);
free(de);
if (m && donotify) {
- doc_notify_change(&dr->doc, prev);
- doc_notify_change(&dr->doc, m);
+ doc_notify_change(&dr->doc, prev, NULL);
+ doc_notify_change(&dr->doc, m, NULL);
}
} else if (de2 &&
(de1 == NULL || strcmp(de2->name, de1->name) < 0)) {
else
list_add_tail(&de2->lst, &dr->ents);
if (m && donotify) {
- doc_notify_change(&dr->doc, prev);
- doc_notify_change(&dr->doc, m);
+ doc_notify_change(&dr->doc, prev, NULL);
+ doc_notify_change(&dr->doc, m, NULL);
}
} else {
/* de1 and de2 are the same. Just step over de1 and
if (!donotify) {
m = doc_first_mark_all(&dr->doc);
if (m)
- doc_notify_change(&dr->doc, m);
+ doc_notify_change(&dr->doc, m, NULL);
}
if (name) {
if (early && !text_ref_same(t, &early->ref, &start))
early = NULL;
- point_notify_change(&t->doc, dd->point, early);
+ doc_notify_change(&t->doc, dd->point, early);
text_check_consistent(t);
}
text_check_consistent(t);
}
- point_notify_change(&t->doc, pm, early);
+ doc_notify_change(&t->doc, pm, early);
return first ? 1 : 2;
}
c = list_next_entry(c, lst);
o = c->start;
}
- doc_notify_change(&t->doc, ci->mark);
+ doc_notify_change(&t->doc, ci->mark, NULL);
return attr_set_str(&c->attrs, attr, val, o);
}