]> git.neil.brown.name Git - edlib.git/commitdiff
Point_notify_change: pass doc explicitly, don't use point.
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 23:49:52 +0000 (10:49 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 23:55:38 +0000 (10:55 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
core-mark.c
core.h
doc-text.c

index 7799a4f4764f46211212b85ed7cc255d3f981530..12a2f7a2fba02bb7fca221e45b635e7755acc075 100644 (file)
@@ -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 a2927135aea61c1a1fac0712d1f3fdf97b10955a..bbb9ac9eabc16490c95e998afda56bdc8a7916ca 100644 (file)
--- 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);
index 4fda303230274d96a8b7395bc8cc4c62b2d14d91..b344110f6de0314ac920a6c607b96c80abcbe88c 100644 (file)
@@ -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;
 }