]> git.neil.brown.name Git - edlib.git/commitdiff
Change popup to store the doc rather than the pane for the temp document.
authorNeilBrown <neil@brown.name>
Fri, 27 Nov 2015 01:55:27 +0000 (12:55 +1100)
committerNeilBrown <neil@brown.name>
Fri, 27 Nov 2015 01:55:27 +0000 (12:55 +1100)
This makes it easier to eventually destroy.

Signed-off-by: NeilBrown <neil@brown.name>
lib-popup.c

index 5f4af25523e08d726f59d1c4456279fe2e77f677..4ea0d7189b3275bfde825482fc89e0fb65ca51b2 100644 (file)
@@ -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);