Zsh Mailing List Archive
Messages sorted by:
Re: X=`cat ~/y` completion
- X-seq: zsh-users 21609
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: X=`cat ~/y` completion
- Date: Fri, 3 Jun 2016 12:29:05 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=7sYUn92W9GihBqK4YDloqePz30L0wamtbLl6fcdPTRQ=; b=rkQL2ztce/F+ptTZOo892d0pjRhgubADDqmUTc4qvoycO0i2WTj4rtXr22j+LPIOLf bGiF1ECrdibQDyAFONM6d0oChIonPNI45T8BXSRmCcT3MMibdrMHFsdWlYVT+qmsXN4v c0LIqWJn44klheUh2DrxOk36Ny4n86iy26wLC7+2zzt1xrr/brfkCMoMxfweOTnifpR5 4OGcgWBw9nvykXM8yKs16FF6/FkJuLq5tKMNtW+NJxW0XdW3F2vo611NsCpncZ5t+vM+ SlC3cKWxL/9t5RrEM1OvAn7ffeocojn4ZrQ64Tj80D+upG/glD+YeC4TNktrlPoSuN9w 0H4g==
- In-reply-to: <20160603053123.GA26773@fujitsu.shahaf.local2>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160603053123.GA26773@fujitsu.shahaf.local2>
[This is more properly a -workers discussion but I'll continue on -users
because we started here.]
On Jun 3, 5:31am, Daniel Shahaf wrote:
} Subject: X=`cat ~/y` completion
} Consider the following two cases:
} % X=`cat $HOME/t<TAB>
} % X=`cat ~/t<TAB>
} In 'zsh -f' + compinit, the former works but the latter doesn't.
} I expect the latter to behave as the former does.
} The last related discussion seems to be 35515/35539.
I don't think those are related, completing after ~/ works elsewhere.
The real difficulty seems to follow from testing $compstate[quote] on
} 276 elif [[ "$pre" = \~ && -z "$compstate[quote]" ]]; then
} 278 # It begins with `~', so [...]
The word on line does begin with tilde, but that's ignored because it is
inside the backticks.
The test could be either != [\'\"] or = (|\`) but I went with the latter
because the former confuses vim syntax highlighting.
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index c64ebf5..14c4cc7 100644
@@ -273,7 +273,7 @@ if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \'
prepaths=( '' )
-elif [[ "$pre" = \~ && -z "$compstate[quote]" ]]; then
+elif [[ "$pre" = \~ && "$compstate[quote]" = (|\`) ]]; then
# It begins with `~', so remember anything before the first slash to be able
# to report it to the completion code. Also get an expanded version of it
Messages sorted by: