scripts/cd in rvm-1.0.15 vs scripts/cd in rvm-1.0.17

- old
+ new

@@ -43,44 +43,49 @@ rvm_hook="after_cd" ; source "$rvm_path/scripts/hook" return $result } - _rvm_cd_complete () - { - local directory current matches item index + # + # Can someone please explain to me what this was meant to accomplish? + # telemachus was encountering issues when he had CDPATH set. + # Namely comletion stopped working. + # + # _rvm_cd_complete () + # { + # local directory current matches item index - COMPREPLY=() + # COMPREPLY=() - current="${COMP_WORDS[COMP_CWORD]}" + # current="${COMP_WORDS[COMP_CWORD]}" - if [[ -n "$CDPATH" ]] ; then + # if [[ -n "$CDPATH" ]] ; then - index=${#COMPREPLY[@]} + # index=${#COMPREPLY[@]} - for directory in $(echo "$CDPATH" | tr -s ':' ' ') ; do + # for directory in $(printf "$CDPATH" | tr -s ':' ' ') ; do - for item in $( compgen -d "$directory/$current" ) ; do + # for item in $( compgen -d "$directory/$current" ) ; do - item="${item}/" + # item="${item}/" - COMPREPLY[index++]=${item#$directory/} + # COMPREPLY[index++]=${item#$directory/} - done + # done - done + # done - COMPREPLY=( $(echo ${COMPREPLY} | uniq | sort) ) + # COMPREPLY=( $(echo ${COMPREPLY} | uniq | sort) ) - else + # else - COMPREPLY=( $(compgen -d ${current}) ) + # COMPREPLY=( $(compgen -d ${current}) ) - fi + # fi - complete -o filenames -o nospace -F _rvm_cd_complete cd + # } - } + # complete -o filenames -o dirnames -o nospace -F _rvm_cd_complete cd fi fi