From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: bad math expression error inside _pick_variant when running insert-all-matches for ls
Date: Mon, 28 Sep 2020 17:51:16 +0100 (BST) [thread overview]
Message-ID: <198519070.131537.1601311876085@mail2.virginmedia.com> (raw)
In-Reply-To: <19322492.131386.1601311622569@mail2.virginmedia.com>
> On 28 September 2020 at 17:47 Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> > On 28 September 2020 at 17:30 Mikael Magnusson <mikachu@gmail.com> wrote:
> > On 9/28/20, lilydjwg <lilydjwg@gmail.com> wrote:
> > > bindkey '^Xi' insert-all-matches
> > >
> > > And then type:
> > >
> > > ls ^Xi
> > >
> > > There is an error message:
> > >
> > > _pick_variant:19: bad math expression: operand expected at `|| 0 ) '
> > >
> > > I'm using zsh 5.8 on Arch Linux.
> >
> > You should either complain to the person who wrote insert-all-matches,
> > or provide the code here, otherwise nobody has any chance to guess
> > what's wrong.
>
> While I was thinking that, I suspect that, whatever's causing this, changing
> $precommands[(I)builtin] on that line to ${precommands[(I)builtin]:-0]} would
> probably make it go away...
And a bit lower down... sorry, should probably have sent this before...
pws
--- a/Completion/Base/Utility/_pick_variant
+++ b/Completion/Base/Utility/_pick_variant
@@ -16,10 +16,10 @@ done
if (( ${#precommands:|builtin_precommands} )); then
pre=command
-elif (( $+opts[-b] && ( $precommands[(I)builtin] || $+builtins[$opts[-c]] ) )); then
+elif (( $+opts[-b] && ( ${precommands[(I)builtin]:-0} || $+builtins[$opts[-c]] ) )); then
(( $+opts[-r] )) && : ${(P)opts[-r]::=$opts[-b]}
return 0
-elif (( $precommands[(I)builtin] )); then
+elif (( ${precommands[(I)builtin]:-0} )); then
pre=builtin
else
# Neither builtin nor command-forcing precommand specified,
next prev parent reply other threads:[~2020-09-28 16:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 15:39 lilydjwg
2020-09-28 16:30 ` Mikael Magnusson
2020-09-28 16:47 ` Peter Stephenson
2020-09-28 16:51 ` Peter Stephenson [this message]
2020-09-28 17:02 ` Roman Perepelitsa
2020-09-28 17:06 ` Peter Stephenson
2020-09-28 17:51 ` lilydjwg
2020-09-28 20:42 ` Bart Schaefer
2020-09-29 6:10 ` Oliver Kiddle
2020-09-29 14:59 ` lilydjwg
2020-10-04 17:11 ` Daniel Shahaf
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=198519070.131537.1601311876085@mail2.virginmedia.com \
--to=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).