int redraw;
int pass = (flags & M_PASS);
int first = 1;
- int tabs = 0; /* number of *consecutive* TABs */
int ch, w, r;
size_t i;
wchar_t *tempbuf = 0;
{
first = 0;
if (ch != OP_EDITOR_COMPLETE)
- tabs = 0;
+ state->tabs = 0;
redraw = M_REDRAW_LINE;
switch (ch)
{
/* fall through to completion routine (M_FILE) */
case OP_EDITOR_COMPLETE:
- tabs++;
+ state->tabs++;
if (flags & M_CMD)
{
for (i = state->curpos; i && state->wbuf[i-1] != ' '; i--)
i = strlen (buf);
if (i && buf[i - 1] == '=' &&
mutt_var_value_complete (buf, buflen, i))
- tabs = 0;
- else if (!mutt_command_complete (buf, buflen, i, tabs))
+ state->tabs = 0;
+ else if (!mutt_command_complete (buf, buflen, i, state->tabs))
BEEP ();
replace_part (state, 0, buf);
}
if (flags & M_ALIAS)
{
/* invoke the query-menu to get more addresses */
- if (state->curpos)
+ if ((i = state->curpos))
{
- for (i = state->curpos; i && state->wbuf[i - 1] != ','; i--)
+ for (; i && state->wbuf[i - 1] != ','; i--)
;
for (; i < state->curpos && state->wbuf[i] == ' '; i++)
;
- my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);
- mutt_query_complete (buf, buflen);
- replace_part (state, i, buf);
- }
- else
- {
- my_wcstombs (buf, buflen, state->wbuf, state->curpos);
- mutt_query_menu (buf, buflen);
- replace_part (state, 0, buf);
}
+
+ my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);
+ mutt_query_complete (buf, buflen);
+ replace_part (state, i, buf);
+
rv = 1;
goto bye;
}
self_insert:
- tabs = 0;
+ state->tabs = 0;
/* use the raw keypress */
ch = LastKey;