]> git.neil.brown.name Git - edlib.git/commitdiff
doc-dir: locate the editor before destroying the pane which lets us find it.
authorNeilBrown <neil@brown.name>
Fri, 27 Nov 2015 04:18:29 +0000 (15:18 +1100)
committerNeilBrown <neil@brown.name>
Fri, 27 Nov 2015 04:34:44 +0000 (15:34 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
doc-dir.c

index 47908e9d3abe4b21177cd3ec1b5b56d8ef49dcde..34cd12b9fd3b92a3994736d27bf1876512d2055d 100644 (file)
--- a/doc-dir.c
+++ b/doc-dir.c
@@ -505,6 +505,7 @@ DEF_CMD(dir_open)
        struct directory *dr = container_of(dd->doc, struct directory, doc);
        struct dir_ent *de = ci->mark->ref.d;
        struct pane *par = p->parent;
+       struct editor *ed = dr->doc.ed;
        int fd;
        char *fname = NULL;
        char *renderer = NULL;
@@ -528,7 +529,7 @@ DEF_CMD(dir_open)
        if (p)
                pane_close(p);
        if (fd >= 0) {
-               p = doc_open(dd->doc->ed, fd, fname);
+               p = doc_open(ed, fd, fname);
                if (p)
                        p = doc_attach_view(par, p, renderer);
                close(fd);