Fix regressions and further tweak previous java completion patch.
Fix inner class regression, adapt test suite, turn off nospace for single class completions, protect -o nospace for bash < 4.
This commit is contained in:
parent
920b1f93b6
commit
a73774c833
@ -72,11 +72,14 @@ _java_classes()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ -d $i ]; then
|
elif [ -d $i ]; then
|
||||||
compopt -o nospace
|
compopt -o nospace &>/dev/null
|
||||||
COMPREPLY=( "${COMPREPLY[@]}"
|
COMPREPLY=( "${COMPREPLY[@]}"
|
||||||
$( compgen -d -- $i/$cur | sed -e "s|^$i/\(.*\)|\1.|" )
|
$( compgen -d -- "$i/$cur" | sed -e "s|^$i/\(.*\)|\1.|" )
|
||||||
$( compgen -f -X '!*.class' -- $i/$cur | sed -e "s|^$i/||" )
|
$( compgen -f -X '!*.class' -- "$i/$cur" | \
|
||||||
|
sed -e '/\$/d' -e "s|^$i/||" )
|
||||||
)
|
)
|
||||||
|
[[ ${#COMPREPLY[@]} == 1 && ${COMPREPLY[0]} == *.class ]] && \
|
||||||
|
compopt +o nospace &>/dev/null
|
||||||
|
|
||||||
# FIXME: if we have foo.class and foo/, the completion
|
# FIXME: if we have foo.class and foo/, the completion
|
||||||
# returns "foo/"... how to give precedence to files
|
# returns "foo/"... how to give precedence to files
|
||||||
|
@ -18,7 +18,7 @@ assert_complete_any "java -"
|
|||||||
sync_after_int
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
assert_complete "b bashcomp.jarred toplevel" "java "
|
assert_complete "b bashcomp.jarred c. toplevel" "java "
|
||||||
|
|
||||||
|
|
||||||
sync_after_int
|
sync_after_int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user