mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
fix for directories with spaces
This commit is contained in:
parent
0f457b436d
commit
3d4f8a4d4f
2
autojump
2
autojump
@ -108,6 +108,6 @@ else:
|
|||||||
if userchoice!=-1:
|
if userchoice!=-1:
|
||||||
if len(results) > userchoice-1 : print results[userchoice-1]
|
if len(results) > userchoice-1 : print results[userchoice-1]
|
||||||
elif len(results) > 1 and completion:
|
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:
|
else:
|
||||||
if results : print results[0]
|
if results : print results[0]
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
if [ $SHELL = "/bin/bash" ] && [ -n "$PS1" ]; then
|
if [ $SHELL = "/bin/bash" ] && [ -n "$PS1" ]; then
|
||||||
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
|
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
|
||||||
alias jumpstat="autojump --stat"
|
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
|
fi
|
||||||
|
@ -5,27 +5,9 @@
|
|||||||
_autojump()
|
_autojump()
|
||||||
{
|
{
|
||||||
local cur
|
local cur
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[1]}
|
cur=${COMP_WORDS[1]}
|
||||||
COMPREPLY=($(autojump --completion "$cur"))
|
IFS=$'\n' read -d '' -a 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
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
}
|
}
|
||||||
complete -F _autojump j
|
complete -F _autojump j
|
||||||
|
Loading…
Reference in New Issue
Block a user