fix for directories with spaces

pull/18/head
Joël Schaerer 16 years ago
parent 0f457b436d
commit 3d4f8a4d4f

@ -108,6 +108,6 @@ else:
if userchoice!=-1:
if len(results) > userchoice-1 : print results[userchoice-1]
elif len(results) > 1 and completion:
print " ".join(("%s__%d__%s" % (pattern,n+1,r) for n,r in enumerate(results[:8])))
print "\n".join(("%s__%d__%s" % (pattern,n+1,r) for n,r in enumerate(results[:8])))
else:
if results : print results[0]

@ -3,5 +3,5 @@
if [ $SHELL = "/bin/bash" ] && [ -n "$PS1" ]; then
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
alias jumpstat="autojump --stat"
function j { new_path=$(autojump $@);if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
fi

@ -5,27 +5,9 @@
_autojump()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[1]}
COMPREPLY=($(autojump --completion "$cur"))
# case "$cur" in
# -*)
# COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \
# -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \
# -tb -tn -to -u -v -ver -vp -x -x@ -y' -- $cur ) )
# ;;
# *)
# if [ $COMP_CWORD -eq 1 ]; then
# COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- $cur ) )
# else
# _filedir '@(rar|RAR)'
# fi
# ;;
# esac
IFS=$'\n' read -d '' -a COMPREPLY < <(autojump --completion "$cur")
return 0
}
complete -F _autojump j

Loading…
Cancel
Save