Handle `j -- -foo` (for bash and zsh only)

Ref: #310
pull/311/head
Daniel Hahler 10 years ago committed by William Ting
parent e621603e46
commit c0c9398794

@ -60,7 +60,7 @@ from autojump_utils import sanitize
from autojump_utils import take from autojump_utils import take
from autojump_utils import unico from autojump_utils import unico
VERSION = '22.1.1-beta' VERSION = '22.2.0-beta'
FUZZY_MATCH_THRESHOLD = 0.6 FUZZY_MATCH_THRESHOLD = 0.6
TAB_ENTRIES_COUNT = 9 TAB_ENTRIES_COUNT = 9
TAB_SEPARATOR = '__' TAB_SEPARATOR = '__'

@ -54,7 +54,7 @@ esac
# default autojump command # default autojump command
j() { j() {
if [[ ${@} =~ ^-{1,2}.* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return return
fi fi
@ -74,8 +74,9 @@ j() {
# jump to child directory (subdirectory of current path) # jump to child directory (subdirectory of current path)
jc() { jc() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return
else else
j $(pwd) ${@} j $(pwd) ${@}
fi fi
@ -84,7 +85,7 @@ jc() {
# open autojump results in file browser # open autojump results in file browser
jo() { jo() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return return
fi fi
@ -116,8 +117,9 @@ jo() {
# open autojump results (child directory) in file browser # open autojump results (child directory) in file browser
jco() { jco() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return
else else
jo $(pwd) ${@} jo $(pwd) ${@}
fi fi

@ -44,7 +44,7 @@ chpwd_functions+=autojump_chpwd
# default autojump command # default autojump command
j() { j() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return return
fi fi
@ -65,8 +65,9 @@ j() {
# jump to child directory (subdirectory of current path) # jump to child directory (subdirectory of current path)
jc() { jc() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return
else else
j $(pwd) ${@} j $(pwd) ${@}
fi fi
@ -75,7 +76,7 @@ jc() {
# open autojump results in file browser # open autojump results in file browser
jo() { jo() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return return
fi fi
@ -108,8 +109,9 @@ jo() {
# open autojump results (child directory) in file browser # open autojump results (child directory) in file browser
jco() { jco() {
if [[ ${@} == -* ]]; then if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@} autojump ${@}
return
else else
jo $(pwd) ${@} jo $(pwd) ${@}
fi fi

Loading…
Cancel
Save