From: Evan Underscore <evanunderscore@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: zsh-workers@zsh.org
Subject: Re: bashcompinit incorrectly calculates COMP_LINE (proposed fix included)
Date: Mon, 20 Nov 2017 09:55:45 +1100 [thread overview]
Message-ID: <CACiQ9RFt5N3j9Jwt=pq0Esk5KoLsxxBtNyqexdOvNkh67Pj8Sg@mail.gmail.com> (raw)
In-Reply-To: <20171119194940.74dd8cea@ntlworld.com>
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
Yes, that patch works for me for the following test cases:
./demo.py new test[tab] (COMP_POINT=18)
./demo.py new test [tab] (COMP_POINT=19)
./demo.py new 你好嘚瑟[tab] (COMP_POINT=18)
./demo.py new 你好嘚瑟 [tab] (COMP_POINT=19)
Thanks.
On Mon, Nov 20, 2017 at 6:49 AM, Peter Stephenson <
p.w.stephenson@ntlworld.com> wrote:
> On Fri, 17 Nov 2017 20:19:25 +1100
> Evan Underscore <evanunderscore@gmail.com> 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 )
>
prev parent reply other threads:[~2017-11-19 22:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 9:19 Evan Underscore
2017-11-19 19:49 ` Peter Stephenson
2017-11-19 22:55 ` Evan Underscore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACiQ9RFt5N3j9Jwt=pq0Esk5KoLsxxBtNyqexdOvNkh67Pj8Sg@mail.gmail.com' \
--to=evanunderscore@gmail.com \
--cc=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).