diff --git a/bin/autojump b/bin/autojump index 9aed2e3..511401e 100755 --- a/bin/autojump +++ b/bin/autojump @@ -29,7 +29,7 @@ import shutil import sys from tempfile import NamedTemporaryFile -VERSION = 'release-v21-rc' +VERSION = 'release-v21-rc.1' MAX_KEYWEIGHT = 1000 MAX_STORED_PATHS = 1000 COMPLETION_SEPARATOR = '__' diff --git a/bin/autojump.bash b/bin/autojump.bash index 93cde45..ea861a6 100644 --- a/bin/autojump.bash +++ b/bin/autojump.bash @@ -63,7 +63,7 @@ case $PROMPT_COMMAND in esac function j { - if [[ ${@} =~ -.* ]]; then + if [[ ${@} =~ ^-{1,2}.* ]]; then autojump ${@} return fi diff --git a/bin/autojump.zsh b/bin/autojump.zsh index a781c9e..c9e6880 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -1,8 +1,8 @@ # determine the data directory according to the XDG Base Directory Specification if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} == *${USER}* ]]; then - export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump" + export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump" else - export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump + export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump fi if [[ ! -e ${AUTOJUMP_DATA_DIR} ]]; then @@ -36,10 +36,11 @@ typeset -ga preexec_functions preexec_functions+=autojump_preexec function j { - if [[ ${@} == -* ]]; then - autojump ${@} - return - fi + # Cannot use =~ due to MacPorts zsh v4.2, see issue #125. + if [[ ${@} == -* ]]; then + autojump ${@} + return + fi local new_path="$(autojump $@)" if [ -d "${new_path}" ]; then