From: Kevin McCarthy Date: Tue, 31 Jan 2017 23:02:21 +0000 (-0800) Subject: Minor fix to ~y completion. X-Git-Tag: neomutt-20170225~32^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03bbc8bb3a3694f4b9ea03f60c9a95edeb897cfe;p=neomutt Minor fix to ~y completion. Make sure the entire ~y is before curpos when enabling completion. --- diff --git a/enter.c b/enter.c index 108311ef0..dbbd786fb 100644 --- a/enter.c +++ b/enter.c @@ -587,7 +587,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, { for (i = state->curpos; i && state->wbuf[i-1] != '~'; i--) ; - if (i && state->wbuf[i-1] == '~' && state->wbuf[i] == 'y') + if (i && i < state->curpos && state->wbuf[i-1] == '~' && state->wbuf[i] == 'y') { i++; my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);