Signed-off-by: NeilBrown <neil@brown.name>
*/
int i;
struct cmd_info ci2 = {0};
- struct point p, *pt;
d->deleting = 1;
if (d == d->ed->docs)
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);
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)) {
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)) {