From f760bd6064d429a851ec5a57a2c1b7896a1c0e51 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 13 Aug 2016 01:32:31 +0200 Subject: 39026: pattern specified with _arguments' -A option shouldn't be checked against words after the cursor --- Src/Zle/computil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Src/Zle/computil.c') diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 0028ac1ca..ecfa2bc34 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2167,9 +2167,11 @@ ca_parse_line(Cadef d, int multi, int first) #endif ) return 1; - else if (state.arg && (!napat || !pattry(napat, line))) { + else if (state.arg && + (!napat || cur <= compcurrent || !pattry(napat, line))) { /* Otherwise it's a normal argument. */ - if (napat && ca_inactive(d, NULL, cur + 1, 1, NULL)) + if (napat && cur <= compcurrent && + ca_inactive(d, NULL, cur + 1, 1, NULL)) return 1; arglast = 1; -- cgit 1.4.1