int fd;
struct pane *par, *pop, *docp;
struct cmd_info ci2 = {0};
+ int ret;
d = str;
while ((c = strstr(d, "//")) != NULL)
ci2.key = "Complete:prefix";
ci2.str = b;
ci2.focus = par;
- key_handle_focus(&ci2);
+ ret = key_handle_focus(&ci2);
free(d);
- if (ci2.str && (strlen(ci2.str) <= strlen(b) && ci2.extra > 1)) {
+ if (ci2.str && (strlen(ci2.str) <= strlen(b) && ret-1 > 1)) {
/* We need the dropdown */
pane_damaged(par, DAMAGED_CONTENT);
free(str);
char *str = doc_getstr(ci->focus, NULL);
struct pane *par, *pop;
struct cmd_info ci2 = {0};
+ int ret;
pop = pane_attach(ci->focus, "popup", ed->docs->home, "DM1r");
if (!pop)
ci2.key = "Complete:prefix";
ci2.str = str;
ci2.focus = par;
- key_handle_focus(&ci2);
- if (ci2.str && (strlen(ci2.str) <= strlen(str) && ci2.extra > 1)) {
+ ret = key_handle_focus(&ci2);
+ if (ci2.str && (strlen(ci2.str) <= strlen(str) && ret - 1 > 1)) {
/* We need the dropdown */
pane_damaged(par, DAMAGED_CONTENT);
free(str);
common[common_len(c, common)] = 0;
cnt += 1;
}
- ci->extra = cnt;
ci->str = common;
call3("Move-to", ci->home, 0, m);
mark_free(m);
call3("render-lines:redraw", ci->focus, 0, NULL);
- return 1;
+ return cnt + 1;
}
DEF_CMD(complete_return)