From bd3d49e1966b5dcaebe2ee3c4d05635fb35d69dd Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 26 Nov 2015 12:09:15 +1100 Subject: [PATCH] Change doc:destroy to work with pane rather than point. Signed-off-by: NeilBrown --- core-doc.c | 8 ++------ doc-dir.c | 2 +- doc-text.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core-doc.c b/core-doc.c index 0e723b5c..a62936d6 100644 --- a/core-doc.c +++ b/core-doc.c @@ -598,7 +598,6 @@ int doc_destroy(struct doc *d) */ int i; struct cmd_info ci2 = {0}; - struct point p, *pt; d->deleting = 1; if (d == d->ed->docs) @@ -618,11 +617,8 @@ int doc_destroy(struct doc *d) pane_close(d->home); ci2.key = "doc:destroy"; - /* Hack ... will go */ - p.doc = d; - pt = &p; - ci2.pointp = &pt; - key_lookup(d->map, &ci2); + ci2.focus = d->home; + key_handle_focus(&ci2); free(d->views); attr_free(&d->attrs); diff --git a/doc-dir.c b/doc-dir.c index a6abbc9e..1145b2ef 100644 --- a/doc-dir.c +++ b/doc-dir.c @@ -484,7 +484,7 @@ DEF_CMD(dir_get_attr) DEF_CMD(dir_destroy) { - struct doc *d = (*ci->pointp)->doc; + struct doc *d = ci->home->data; struct directory *dr = container_of(d, struct directory, doc); while (!list_empty(&dr->ents)) { diff --git a/doc-text.c b/doc-text.c index 270af023..a74f5d48 100644 --- a/doc-text.c +++ b/doc-text.c @@ -1502,7 +1502,7 @@ DEF_CMD(text_set_attr) DEF_CMD(text_destroy) { - struct doc *d = (*ci->pointp)->doc; + struct doc *d = ci->focus->data; struct text *t = container_of(d, struct text, doc); while (!list_empty(&t->text)) { -- 2.39.5