Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bashcompinit incorrectly calculates COMP_LINE (proposed fix included)
- X-seq: zsh-workers 42037
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Evan Underscore <evanunderscore@xxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: bashcompinit incorrectly calculates COMP_LINE (proposed fix included)
- Date: Sun, 19 Nov 2017 19:49:40 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1511120982; bh=E4h/dA6MvhI9ZQHfjjPDGBb0miL+yFNqJzki2AK6LNg=; h=Date:From:To:Subject:In-Reply-To:References; b=RwPxE/rq/IfsKo1OZP7dgYEU35tAM0BnEdMRq+5Pw53IYhS/GR1c0DQ66r5s15n1g bVg5y44l6h877p68Lyic03skTUrwnrihtGRfUZSS+m0aukUENkomwGeg+CdDbouWlz au7xUA+jt20IoWjRRo96DyfWuZFuvRlAl5wKrVX0Iq80QZVneQwiCVOyESbvU03EUw eYsv0hIi6dsTGi6iznKTR0yUs+xs9uJmzr6BithbpoPfRUb7Y4djW1L+BHlZQUk9wE 9pFQf9Mgy4P/jjeGyzX+zrhG+BiUWU5n0drgYIW73YdlEXGeEHmFeFrzpac+jw2fSm 9Kai63Ilgc35w==
- In-reply-to: <CACiQ9RGKzNXY+bpnGdXxvjUvvpnm+NipOiyxpOL2Ua-Wcv6sSw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CACiQ9RGKzNXY+bpnGdXxvjUvvpnm+NipOiyxpOL2Ua-Wcv6sSw@mail.gmail.com>
On Fri, 17 Nov 2017 20:19:25 +1100
Evan Underscore <evanunderscore@xxxxxxxxx> wrote:
> Reverting this line (i.e. using CURRENT-1 instead of CURRENT, as it was
> before this commit) fixes the bug for me, causing zsh to report 18 and 19
> for the two test lines respectively, matching Bash.
So I think so suggesting the following patch gives the correct behaviour
under all circumstances you aware of?
pws
diff --git a/Completion/bashcompinit b/Completion/bashcompinit
index 902fa88..02290a1 100644
--- a/Completion/bashcompinit
+++ b/Completion/bashcompinit
@@ -8,7 +8,7 @@ _bash_complete() {
local -x COMP_LINE="$words"
local -A savejobstates savejobtexts
- (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))
+ (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT-1]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))
(( COMP_CWORD = CURRENT - 1))
COMP_WORDS=( $words )
BASH_VERSINFO=( 2 05b 0 1 release )
Messages sorted by:
Reverse Date,
Date,
Thread,
Author