Skip to content

Commit 502fd11

Browse files
committed
fix(java): fix _java_find_sourcepath to store results in array
1 parent 1adf2db commit 502fd11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

completions/java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ _java_find_sourcepath()
5050
_java_find_classpath
5151
sourcepath=$classpath
5252
fi
53+
54+
_comp_split -F : sourcepath "$sourcepath"
5355
}
5456

5557
# available classes completion
@@ -107,11 +109,12 @@ _comp_cmd_java__packages()
107109

108110
# find which sourcepath to use
109111
_java_find_sourcepath
112+
((${#sourcepath[@]})) || return 0
110113

111114
# convert package syntax to path syntax
112115
cur=${cur//.//}
113116
# parse each sourcepath element for packages
114-
for i in ${sourcepath//:/ }; do
117+
for i in "${sourcepath[@]}"; do
115118
if [[ -d $i ]]; then
116119
COMPREPLY+=($(command ls -F -d "$i/$cur"* 2>/dev/null |
117120
command sed -e 's|^'"$i"'/||'))

0 commit comments

Comments
 (0)