Fix #135. Autojump was failing for directories with - due to bad regex.

pull/141/head
William Ting 12 years ago
parent 5613562e8b
commit ca8763aa02

@ -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 = '__'

@ -63,7 +63,7 @@ case $PROMPT_COMMAND in
esac
function j {
if [[ ${@} =~ -.* ]]; then
if [[ ${@} =~ ^-{1,2}.* ]]; then
autojump ${@}
return
fi

@ -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

Loading…
Cancel
Save