From e36e926228ea270a2ff531fc50972a34703b935e Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 27 Nov 2015 12:55:27 +1100 Subject: [PATCH] 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 --- lib-popup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 2.39.5