From: NeilBrown Date: Thu, 26 Nov 2015 23:49:52 +0000 (+1100) Subject: Point_notify_change: pass doc explicitly, don't use point. X-Git-Tag: lca2016~174 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=8f33d96e851480aaa1c71f709fa111d46ed7f31c;p=edlib.git Point_notify_change: pass doc explicitly, don't use point. Signed-off-by: NeilBrown --- diff --git a/core-mark.c b/core-mark.c index 7799a4f4..12a2f7a2 100644 --- a/core-mark.c +++ b/core-mark.c @@ -900,7 +900,7 @@ struct mark *do_vmark_at_point(struct doc *d, struct point *pt, int view) return NULL; } -void point_notify_change(struct point *p, struct mark *m) +void point_notify_change(struct doc *d, struct point *p, struct mark *m) { /* Notify of changes from m (might be NULL) to p. * Notify the last mark which is before p or m, @@ -908,7 +908,6 @@ void point_notify_change(struct point *p, struct mark *m) * There will be none in between. */ struct cmd_info ci = {0}; - struct doc *d = p->doc; int i; ci.key = "Notify:Replace"; @@ -968,7 +967,7 @@ void doc_notify_change(struct doc *d, struct mark *m) int remaining = d->nviews; if (m->viewnum == MARK_POINT) { - point_notify_change(container_of(m, struct point, m), NULL); + point_notify_change(d, container_of(m, struct point, m), NULL); return; } diff --git a/core.h b/core.h index a2927135..bbb9ac9e 100644 --- a/core.h +++ b/core.h @@ -159,7 +159,7 @@ void mark_reset(struct doc *d, struct mark *m); 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 point *p, struct mark *m); +void point_notify_change(struct doc *d, struct point *p, struct mark *m); void doc_notify_change(struct doc *d, struct mark *m); void doc_check_consistent(struct doc *d); void point_to_mark(struct point *p, struct mark *m); diff --git a/doc-text.c b/doc-text.c index 4fda3032..b344110f 100644 --- a/doc-text.c +++ b/doc-text.c @@ -852,7 +852,7 @@ DEF_CMD(text_reundo) if (early && !text_ref_same(t, &early->ref, &start)) early = NULL; - point_notify_change(ci->home->point, early); + point_notify_change(d, ci->home->point, early); text_check_consistent(t); } @@ -1409,7 +1409,7 @@ DEF_CMD(text_replace) text_check_consistent(t); } - point_notify_change(pos, early); + point_notify_change(d, pos, early); ci->numeric = first; return 1; }