return 0;
}
+DEF_CMD(global_set_attr)
+{
+ attr_set_str(&ci->home->attrs, ci->str, ci->str2, -1);
+ return 1;
+}
+
struct pane *editor_new(void)
{
struct editor *ed = calloc(sizeof(*ed), 1);
- if (!ed_map)
+ if (!ed_map) {
ed_map = key_alloc();
+ key_add(ed_map, "global-set-attr", &global_set_attr);
+ }
pane_init(&ed->root, NULL, NULL);
ed->root.handle = &ed_handle.c;
/* already pushed and didn't find anything new */
return 1;
}
+ str = doc_getstr(ci->focus, NULL);
+ if (!*str) {
+ /* re-use old string; Is there any point to this indirection? */
+ char *ss;
+ ss = pane_attr_get(ci->focus, "done-key");
+ if (ss)
+ ss = pane_attr_get(ci->focus, ss);
+ if (ss) {
+ doc_replace(esi->search, NULL, ss, &first);
+ return 1;
+ }
+ }
s = malloc(sizeof(*s));
s->m = esi->start;
- str = doc_getstr(ci->focus, NULL);
s->len = strlen(str);
free(str);
s->next = esi->s;
m = call_mark("doc:dup-point", ci->home, 0, NULL, MARK_UNGROUPED);
+ ci2.key = "global-set-attr";
+ ci2.str = "Search String";
+ ci2.str2 = ci->str;
+ ci2.focus = ci->home;
+ key_handle_focus(&ci2);
+
memset(&ci2, 0, sizeof(ci2));
ci2.focus = ci->home;
ci2.mark = m;