1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-20 06:56:05 +02:00

dana: 42145: Fix additional completion cases with option arguments.

This commit is contained in:
dana 2017-12-19 22:52:29 -06:00 committed by Peter Stephenson
parent 4b55c0f40c
commit 932ed86483
3 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-12-20 Peter Stephenson <p.stephenson@samsung.com>
* dana: 42145: Src/Zle/computil.c, Test/Y03arguments.ztst: fix
for completion option arguments.
2017-12-20 Daniel Shahaf <d.s@daniel.shahaf.name>
* 42146: Src/hashtable.c, Test/A02alias.ztst: type -w +=

View File

@ -2493,7 +2493,9 @@ ca_set_data(LinkList descr, LinkList act, LinkList subc,
* the case above right.
*/
if (arg->type == CAA_NORMAL &&
opt && optdef && optdef->type == CAO_NEXT)
opt && optdef &&
(optdef->type == CAO_NEXT || optdef->type == CAO_ODIRECT ||
optdef->type == CAO_OEQUAL))
return;
if (single)

View File

@ -237,6 +237,27 @@
>NO:{-a}
>NO:{-b}
tst_arguments '*'{-x+,--xxx=}':optarg:(1)' '*:operand:(a)'
comptest $'tst \t'
comptest $'tst -x \t'
comptest $'tst -x\t'
comptest $'tst --xxx=\t'
comptest $'tst --xxx \t'
comptest $'tst a -x\t'
comptest $'tst a -x \t'
comptest $'tst a --xxx=\t'
comptest $'tst a --xxx \t'
0:optarg completion following rest operand on line (workers/42141)
>line: {tst a }{}
>line: {tst -x 1 }{}
>line: {tst -x1 }{}
>line: {tst --xxx=1 }{}
>line: {tst --xxx 1 }{}
>line: {tst a -x1 }{}
>line: {tst a -x 1 }{}
>line: {tst a --xxx=1 }{}
>line: {tst a --xxx 1 }{}
tst_arguments '-a' '*::rest:{compadd - -b}'
comptest $'tst arg -\t'
0:rest arguments