Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] Weird _expand & _complete behavior for $parameters in "double quotes"



On Tue, May 11, 2021 at 2:05 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I can't reproduce this on either Ubutu or MacOS, nor either with or
> without my completeinword patch from the other day.

I tried it again, but this time as follows:

make realclean
Util/preconfig
configure
make all TESTNUM=Y01 check

I still get the exact same test failure. macOS, commit
9e38ab81785c4ac755a7e78d2fe7a7db92bdf375.

Here's the test as a patch, in case it helps you reproduce it.
From f5d77fe457da42de2bb23ba95476cc14466d19c0 Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@xxxxxxxxx>
Date: Tue, 11 May 2021 20:27:50 +0300
Subject: [PATCH] _expand & _complete $parameters in "double quotes"

---
 Test/Y01completion.ztst | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index 2c6d25d9a..8034f0c67 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -282,6 +282,19 @@ F:regression test workers/31611
 >NO:{bar}
 >NO:{baz}
 
+  comptesteval "typeset -a bar=({$'\\0'..$'\\C-?'})"
+  comptesteval 'typeset -A bat=( "$bar[@]" )'
+  comptesteval 'typeset bay="$bar"'
+  comptesteval 'unsetopt listambiguous'
+  comptest $': "$ba"\C-B\t\t'
+0: complete parameter in double quotes
+>line: {: "$ba}{"}
+>DESCRIPTION:{parameter}
+>NO:{bar}
+>NO:{bat}
+>NO:{bay}
+>line: {: "$bar}{"}
+
   comptesteval '_tst() { local disp=( {a..z} ); compadd -ld disp $disp[@]; comppostfuncs=( _pst ) }'
   comptesteval '_pst() { local disp=( "<INSERT>$compstate[insert]</INSERT>" ); compadd -Qld disp $disp }'
   comptesteval "zstyle ':completion:*' menu select=long-list"
-- 
2.31.1



Messages sorted by: Reverse Date, Date, Thread, Author