Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: cd auto-completion of .. fails with parentheses in directory name
- X-seq: zsh-workers 40024
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Bug: cd auto-completion of .. fails with parentheses in directory name
- Date: Sun, 27 Nov 2016 19:39:26 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tKC6G3d8t8n7IYuyzmIxLqAJy//bC2dQCeA/k7Y++YQ=; b=tMFQ2SI5n8BUR/3h/dNnDQcc8nZ/xAvMvQK0utew0oYB3PK+zZFGlApZfLEfDtpSWD 2z05XF6+TwYVdPXiC3/7SSnc0WxAEhOfSJkr3cCezj3e03IFJCZR1K8ix+UyKw5AiBj0 QT3zIZKYizfsoUg7JAJ3S0XVu6zNxTU0sw6aIcqnScg1DPLB+aYOEXJ2aYDwTkV39irk Ew2CCq7XRXdUlBa5TPwFoL0KkpvyfxeiS8UDDGS2iMcbNyTdb2YNinvZp8vVtaamsNFp Ex18M0fQPwpa4QTzvaxmxdJjki+IGd82gRU1lCvh2tXX1/RCRJF/R36W0rNlnIwEi34a 2X+w==
- In-reply-to: <CAHYJk3QGvE2D6CO7ye9280ZTqvGAFmRCW8pEu8Sj=TT7pzo5Dw@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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAPnWG_TR7DC7h36m-jp6PnuY=M4ViwwWNMtaT9aU4wawygzoBg@mail.gmail.com> <20160922144250.GA11076@fujitsu.shahaf.local2> <160922103042.ZM7407@torch.brasslantern.com> <CAHYJk3QmMUr0_C0-aAMYCNsmeXuo14JzVXwuimBk05meeX88wA@mail.gmail.com> <20161028151037.GA10483@fujitsu.shahaf.local2> <20161029180632.GA18192@fujitsu.shahaf.local2> <20161127151706.GA9898@fujitsu.shahaf.local2> <CAHYJk3RPVw2HEM=e-T7f9hXSo3ZWZ=g+x=tuBsC_P0VAqro=aw@mail.gmail.com> <CAHYJk3QGvE2D6CO7ye9280ZTqvGAFmRCW8pEu8Sj=TT7pzo5Dw@mail.gmail.com>
On Sun, Nov 27, 2016 at 7:32 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On Sun, Nov 27, 2016 at 7:30 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> On Sun, Nov 27, 2016 at 4:17 PM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>>> Daniel Shahaf wrote on Sat, Oct 29, 2016 at 18:06:32 +0000:
>>>> diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
>>>> index 0d36b54..32942d7 100644
>>>> --- a/Completion/Unix/Type/_path_files
>>>> +++ b/Completion/Unix/Type/_path_files
>>>> @@ -594,7 +594,7 @@ for prepath in "$prepaths[@]"; do
>>>> # There are more components, so skip over the next components and make a
>>>> # slash be added.
>>>>
>>>> - tmp1=( ${tmp1//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )
>>>> + #tmp1=( ${tmp1//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )
>>>> tmp2="${(M)tpre##${~skips}}"
>>>> if [[ -n "$tmp2" ]]; then
>>>> skipped="/$tmp2"
>>>
>>> I've reviewed the code again. I believe that at the preceding
>>> 'compfiles -i' call, tmp1 is an input parameter containing a list of
>>> unquoted filenames, and is not modified by the call, so this patch is
>>> correct.
>>>
>>> Committed in eccb7471b577d55f0b410088fc1125016476b332, with a regression
>>> test.
>>>
>>> I'd add some reverse-engineered docs for bin_compfiles()'s -i case but
>>> I can't type right now.
>>>
>>> @all, please report breakage if any, with completiosn of oddly-named
>>> directories.
>>
>> It still doesn't work for me, as before.
>
> zstyle ':completion:*' accept-exact-dirs 'yes'
> Seems to be the thing that makes it not work.
This seems to fix it, while also retaining the functionality of
accept-exact-dirs, which is pretty amazing. We probably need PWS to
update the big comment above the code though.
diff --git i/Completion/Unix/Type/_path_files w/Completion/Unix/Type/_path_files
index 32942d7a72..b272f2ce8f 100644
--- i/Completion/Unix/Type/_path_files
+++ w/Completion/Unix/Type/_path_files
@@ -381,7 +381,7 @@ for prepath in "$prepaths[@]"; do
# however, for tmp2 we unquote everything.
tmp1=${match[1]}
tpre=${match[2]}
- tmp2=${(Q)tmp1}
+ tmp2=$tmp1 #${(Q)tmp1}
tmp1=${tmp1//(#b)\\(?)/$match[1]}
tpre=${tpre//(#b)\\([^\\\]\[\^\~\(\)\#\*\?])/$match[1]}
# Theory: donepath needs the quoting of special characters
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author