summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
authorKyle Andelin <7277377+andelink@users.noreply.github.com>2025-04-04 07:53:57 -0700
committerOliver Kiddle <opk@zsh.org>2025-04-04 20:57:51 +0200
commit73c70cece07a9d9e69cf09871877ab28b06d5cfb (patch)
treefe61c9e6ea6f5d564c676c06f2e0abd30fae41e0 /Completion
parent5858f6a12252eb82b7b5942e64dd8679854f0063 (diff)
downloadzsh-73c70cece07a9d9e69cf09871877ab28b06d5cfb.tar.gz
zsh-73c70cece07a9d9e69cf09871877ab28b06d5cfb.zip
53449: do not complete indices for empty array subscripts
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Zsh/Context/_subscript3
1 files changed, 3 insertions, 0 deletions
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 25cedd193..67bad2862 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -98,6 +98,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
while _tags; do
if _requested indexes; then
ind=( {1..${#${(P)${compstate[parameter]}}}} )
+ if [[ ${ind[-1]} -eq 0 ]]; then
+ ind=()
+ fi
if zstyle -T ":completion:${curcontext}:indexes" verbose; then
list=()
for i in "$ind[@]"; do