Commit 956f7c05 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Permit tab completion of pattern expressions with ~y (labels).

Thanks to David Champion for the original patch.  This version is
slightly different, as I couldn't get the original patch working.
This version simply scans backward for the first ~, and if it is ~y,
invokes completion.
parent 3d0b7c22
......@@ -568,7 +568,6 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
}
else if (flags & MUTT_LABEL && ch == OP_EDITOR_COMPLETE)
{
/* invoke the alias-menu to get more addresses */
for (i = state->curpos; i && state->wbuf[i-1] != ',' &&
state->wbuf[i-1] != ':'; i--)
;
......@@ -584,6 +583,26 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
}
break;
}
else if (flags & MUTT_PATTERN && ch == OP_EDITOR_COMPLETE)
{
for (i = state->curpos; i && state->wbuf[i-1] != '~'; i--)
;
if (i && state->wbuf[i-1] == '~' && state->wbuf[i] == 'y')
{
i++;
my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);
r = mutt_label_complete (buf, buflen, strlen (buf), state->tabs);
replace_part (state, i, buf);
if (!r)
{
rv = 1;
goto bye;
}
}
else
goto self_insert;
break;
}
else if (flags & MUTT_ALIAS && ch == OP_EDITOR_COMPLETE_QUERY)
{
/* invoke the query-menu to get more addresses */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment