struct mark *line;
} *prev;
int changed;
- struct map *done_map;
- struct lookup_cmd handle;
};
static struct map *history_map;
struct history_info *hi;
struct pane *p;
- if (!ci->str || !ci->str2)
+ if (!ci->str)
return Enoarg;
alloc(hi, pane);
- hi->done_map = key_alloc();
- hi->handle = history_handle;
- hi->handle.m = &hi->done_map;
- key_add_chain(hi->done_map, history_map);
- key_add(hi->done_map, ci->str2, &history_done);
p = call_ret(pane, "docs:byname", ci->focus, 0, NULL, ci->str);
if (!p)
p = call_ret(pane, "doc:from-text", ci->focus, 0, NULL, ci->str);
call("doc:file", hi->history, 1);
buf_init(&hi->search);
buf_concat(&hi->search, "?0"); /* remaining chars are searched verbatim */
- p = pane_register(ci->focus, 0, &hi->handle.c, hi);
+ p = pane_register(ci->focus, 0, &history_handle.c, hi);
if (!p)
return Efail;
pane_add_notify(p, hi->history, "Notify:Close");
&history_search_cancel);
key_add(history_map, "history:save", &history_save);
key_add(history_map, "history:get-last", &history_hlast);
+ key_add(history_map, "popup:close", &history_done);
}
if (!p)
return Efail;
attr_set_str(&p->attrs, "initial_path", path);
- call("attach-history", p, 0, NULL, "*File History*",
- 0, NULL, "popup:close");
+ call("attach-history", p, 0, NULL, "*File History*");
return 1;
}
if (!ci->str)
if (!p)
return Efail;
attr_set_str(&p->attrs, "initial_path", path);
- call("attach-history", p, 0, NULL, "*File History*",
- 0, NULL, "popup:close");
+ call("attach-history", p, 0, NULL, "*File History*");
return 1;
}
if (!p)
return Efail;
attr_set_str(&p->attrs, "initial_path", path);
- call("attach-history", p, 0, NULL, "*File History*",
- 0, NULL, "popup:close");
+ call("attach-history", p, 0, NULL, "*File History*");
return 1;
}
attr_set_str(&p->attrs, "popup-aux", aux);
attr_set_str(&p->attrs, "done-key", "Shell Command");
call("doc:set-name", p, 0, NULL, "Shell Command", -1);
- p = call_ret(pane, "attach-history", p, 0, NULL, "*Shell History*",
- 0, NULL, "popup:close");
+ p = call_ret(pane, "attach-history", p, 0, NULL, "*Shell History*");
if (p)
p = pane_register(p, 0, &find_handle.c, "shellcmd");
if (!p)
attr_set_str(&p->attrs, "prompt", "Search");
attr_set_str(&p->attrs, "done-key", "Search String");
- hp = call_ret(pane, "attach-history", p, 0, NULL, "*Search History*",
- 0, NULL, "popup:close");
+ hp = call_ret(pane, "attach-history", p, 0, NULL, "*Search History*");
if (hp)
p = hp;
attr_set_str(&p->attrs, "prompt", "Cmd");
attr_set_str(&p->attrs, "done-key", "emacs:command");
call("doc:set-name", p, 0, NULL, "K:Ax command", -1);
- p = call_ret(pane, "attach-history", p, 0, NULL, "*Command History*",
- 0, NULL, "popup:close");
+ p = call_ret(pane, "attach-history", p, 0, NULL, "*Command History*");
if (p)
pane_register(p, 0, &find_handle.c, "cmd");
return 1;