return "<bold,underline> Document File</>";
if (strcmp(attr, "line-format") == 0)
return " %+name:20 %filename";
+ if (strcmp(attr, "default-renderer") == 0)
+ return "format";
return NULL;
}
p = m->ref.p;
doc_init(&ds->doc);
ds->doc.ed = ed;
- ds->doc.default_render = "format";
doc_set_name(&ds->doc, "*Documents*");
ed->docs = &ds->doc;
{
char buf[100];
struct cmd_info ci = {0};
- struct point **ptp;
int ret;
/* always attach a renderer as a leaf */
parent = pane_final_child(parent);
- ptp = pane_point(parent);
- if (!ptp)
- return NULL;
if (!name)
- name = (*ptp)->doc->default_render;
+ name = pane_attr_get(parent, "default-renderer");
+ if (!name)
+ return NULL;
sprintf(buf, "render-%s-attach", name);
ci.key = buf;
ci.focus = parent;
- ci.pointp = ptp;
+ ci.pointp = pane_point(parent);
ret = key_lookup(pane2ed(parent)->commands, &ci);
if (ret)
return ci.focus;
struct pane *home; /* pane in null_display which owns this doc*/
struct map *map;
char *name;
- char *default_render;
short deleting; /* is begin destroyed */
};
doc_init(&dr->doc);
dr->doc.map = doc_map;
- dr->doc.default_render = "format";
INIT_LIST_HEAD(&dr->ents);
dr->fname = NULL;
ci->focus = doc_attach(ed->root.focus, &dr->doc);
return a;
if (strcmp(attr, "heading") == 0)
return "<bold,fg:blue,underline> Perms Mtime Owner Group File Name</>";
+ if (strcmp(attr, "default-renderer") == 0)
+ return "format";
if (strcmp(attr, "line-format") == 0)
return " <fg:red>%perms</> %mdate:13 %user:10 %group:10 <fg:blue>%+name</>";
if (strcmp(attr, "filename") == 0)
INIT_LIST_HEAD(&t->text);
t->undo = t->redo = NULL;
doc_init(&t->doc);
- t->doc.default_render = "lines";
t->doc.map = text_map;
t->fname = NULL;
text_new_alloc(t, 0);
char *a = attr_get_str(d->attrs, attr, -1);
if (a)
return a;
+ if (strcmp(attr, "default-renderer") == 0)
+ return "lines";
if (strcmp(attr, "filename") == 0)
return t->fname;
return NULL;