p = call_ret(pane, "attach-render-complete", par, 0, NULL, "format");
if (!p)
return Efail;
- cr = call_ret(all, "Complete:prefix", p, 1, NULL, b);
+ cr = call_ret(all, "Complete:prefix", p, 1, NULL, b,
+ 0, NULL, "format:plain");
if (cr.s && (strlen(cr.s) <= strlen(b) && cr.ret-1 > 1)) {
/* We need the dropdown - delete prefix and drop-down will
* insert result.
struct complete_data {
char *orig;
+ char *attr;
struct stk {
struct stk *prev;
const char *substr safe;
free(t);
}
+ free(cd->attr);
unalloc(cd, pane);
return 1;
}
np = malloc(pl + strlen(suffix) + 1);
strcpy(np, cd->stk->substr);
strcpy(np+pl, suffix);
- call("Complete:prefix", ci->focus, !cd->prefix_only, NULL, np);
+ call("Complete:prefix", ci->focus, !cd->prefix_only, NULL, np,
+ 0, NULL, cd->attr);
free(np);
return 1;
}
free((void*)stk->substr);
free(stk);
}
- call("Complete:prefix", ci->home, 0, NULL, NULL, 1);
+ call("Complete:prefix", ci->home, 0, NULL, NULL, 1,
+ NULL, cd->attr);
return 1;
}
} else {
cb.ss = cd->stk->substr;
}
+ if (ci->str2 && (!cd->attr || strcmp(cd->attr, ci->str2) != 0)) {
+ free(cd->attr);
+ cd->attr = strdup(ci->str2);
+ }
call_comm("Filter:set", ci->focus, &cb.c,
- cd->prefix_only ? 3 : 2, NULL, cb.ss);
+ cd->prefix_only ? 3 : 2, NULL, cb.ss, 0, NULL, cd->attr);
if (cb.cnt <= 0) {
/* Revert */
call("Filter:set", ci->focus,
- cd->prefix_only ? 3 : 2, NULL, cd->stk->substr);
+ cd->prefix_only ? 3 : 2, NULL, cd->stk->substr,
+ 0, NULL, cd->attr);
if (m)
call("Move-to", ci->focus, 0, m);
}
cd->stk = stk;
cb.common_pre = NULL;
call("Filter:set", ci->focus,
- cd->prefix_only ? 3 : 2, NULL, cd->stk->substr);
+ cd->prefix_only ? 3 : 2, NULL, cd->stk->substr,
+ 0, NULL, cd->attr);
comm_call(ci->comm2, "callback:prefix", ci->focus, cb.cnt,
NULL, cd->stk->substr);
if (!cd->orig)