blob: 4d8e814db7cca7f624e107d3d70301a6e940b9dd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#compdef -vared-
local also
# Completion inside vared.
if [[ $compstate[vared] = *\[* ]]; then
# vared on an array-element
compstate[parameter]=${compstate[vared]%%\[*}
compstate[context]=-value-
also=value
else
# vared on a parameter, let's see if it is an array
compstate[parameter]=$compstate[vared]
if [[ ${(tP)compstate[vared]} = *(array|assoc)* ]]; then
compstate[context]=array_value
also=-array-value-
else
compstate[context]=value
also=-value-
fi
fi
# Don't insert TAB in first column. Never.
compstate[insert]="${compstate[insert]//tab /}"
_compalso "$also"
|