Make saveoptions save changed autocompletions
This commit is contained in:
18
src/cmd.c
18
src/cmd.c
@@ -2952,6 +2952,8 @@ parseautocomplete(char *autocomplete, boolean condition)
|
||||
/* find and modify the extended command */
|
||||
for (efp = extcmdlist; efp->ef_txt; efp++) {
|
||||
if (!strcmp(autocomplete, efp->ef_txt)) {
|
||||
if (condition == ((efp->flags & AUTOCOMPLETE) ? FALSE : TRUE))
|
||||
efp->flags |= AUTOCOMP_ADJ;
|
||||
if (condition)
|
||||
efp->flags |= AUTOCOMPLETE;
|
||||
else
|
||||
@@ -2966,6 +2968,22 @@ parseautocomplete(char *autocomplete, boolean condition)
|
||||
wait_synch();
|
||||
}
|
||||
|
||||
/* add changed autocompletions to the string buffer in config file format */
|
||||
void
|
||||
all_options_autocomplete(strbuf_t *sbuf)
|
||||
{
|
||||
struct ext_func_tab *efp;
|
||||
char buf[BUFSZ];
|
||||
|
||||
for (efp = extcmdlist; efp->ef_txt; efp++)
|
||||
if ((efp->flags & AUTOCOMP_ADJ) != 0) {
|
||||
Sprintf(buf, "AUTOCOMPLETE=%s%s\n",
|
||||
(efp->flags & AUTOCOMPLETE) ? "" : "!",
|
||||
efp->ef_txt);
|
||||
strbuf_append(sbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
/* save&clear the mouse button actions, or restore the saved ones */
|
||||
void
|
||||
lock_mouse_buttons(boolean savebtns)
|
||||
|
||||
Reference in New Issue
Block a user