From: NeilBrown Date: Fri, 27 Nov 2015 01:55:27 +0000 (+1100) Subject: Change popup to store the doc rather than the pane for the temp document. X-Git-Tag: lca2016~163 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=e36e926228ea270a2ff531fc50972a34703b935e;p=edlib.git Change popup to store the doc rather than the pane for the temp document. This makes it easier to eventually destroy. Signed-off-by: NeilBrown --- diff --git a/lib-popup.c b/lib-popup.c index 5f4af255..4ea0d718 100644 --- a/lib-popup.c +++ b/lib-popup.c @@ -30,7 +30,8 @@ #include "core.h" struct popup_info { - struct pane *target, *popup, *doc; + struct pane *target, *popup; + struct doc *doc; char *style; }; @@ -63,7 +64,7 @@ DEF_CMD(popup_handle) if (strcmp(ci->key, "Close") == 0) { if (ppi->doc) - doc_destroy(ppi->doc->data); + doc_destroy(ppi->doc); free(ppi); return 1; } @@ -167,7 +168,7 @@ DEF_CMD(popup_attach) struct doc *d; d = doc_new(pane2ed(root), "text"); doc_set_name(d, "*popup*"); - ppi->doc = d->home; + ppi->doc = d; p = doc_attach_view(ppi->popup, d->home, NULL); } pane_focus(p);