}
return 1;
}
+
+ if (strcmp(ci->key, "Request:Notify:Replace") == 0) {
+ pane_add_notify(ci->focus, dd->doc->home, "Notify:Replace");
+ return 1;
+ }
+
if (strcmp(ci->key, "Clone") == 0) {
struct pane *p = doc_attach(ci->focus, dd->doc);
struct pane *c = pane_child(ci->home);
int i;
struct point_links *lnk = p->mdata;
+ pane_notify(d->home, "Notify:Replace", p, m);
ci.key = "Notify:Replace";
ci.numeric = 1;
ci.x = ci.y = -1;
list_del_init(&n->notifier_link);
if (strcmp(n->notification, "Notify:Close") == 0)
comm_call_pane(n->notifiee, n->notification, p,
- 0, NULL, NULL, 0);
+ 0, NULL, NULL, 0, NULL);
free(n->notification);
free(n);
}
}
+void pane_notify(struct pane *p, char *notification, struct mark *m, struct mark *m2)
+{
+ struct notifier *n;
+
+ list_for_each_entry(n, &p->notifiees, notifier_link)
+ if (strcmp(n->notification, notification) == 0)
+ comm_call_pane(n->notifiee, n->notification, p,
+ 0, m, NULL, 0, m2);
+}
+
void pane_close(struct pane *p)
{
struct pane *c;
struct list_head notifier_link, notifiee_link;
};
void pane_add_notify(struct pane *target, struct pane *source, char *msg);
+void pane_notify(struct pane *p, char *notification, struct mark *m, struct mark *m2);
/* this is ->data for a document pane. Only core-doc and
* individual document handlers can know about this.
}
static inline int comm_call_pane(struct pane *home, char *key, struct pane *focus,
- int numeric, struct mark *m, char *str, int extra)
+ int numeric, struct mark *m, char *str, int extra,
+ struct mark *m2)
{
struct cmd_info ci = {0};
struct command *comm = home->handle;