mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Fix #135. Autojump was failing for directories with - due to bad regex.
This commit is contained in:
parent
5613562e8b
commit
ca8763aa02
@ -29,7 +29,7 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
VERSION = 'release-v21-rc'
|
VERSION = 'release-v21-rc.1'
|
||||||
MAX_KEYWEIGHT = 1000
|
MAX_KEYWEIGHT = 1000
|
||||||
MAX_STORED_PATHS = 1000
|
MAX_STORED_PATHS = 1000
|
||||||
COMPLETION_SEPARATOR = '__'
|
COMPLETION_SEPARATOR = '__'
|
||||||
|
@ -63,7 +63,7 @@ case $PROMPT_COMMAND in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
function j {
|
function j {
|
||||||
if [[ ${@} =~ -.* ]]; then
|
if [[ ${@} =~ ^-{1,2}.* ]]; then
|
||||||
autojump ${@}
|
autojump ${@}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# determine the data directory according to the XDG Base Directory Specification
|
# determine the data directory according to the XDG Base Directory Specification
|
||||||
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} == *${USER}* ]]; then
|
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
|
else
|
||||||
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
|
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -e ${AUTOJUMP_DATA_DIR} ]]; then
|
if [[ ! -e ${AUTOJUMP_DATA_DIR} ]]; then
|
||||||
@ -36,10 +36,11 @@ typeset -ga preexec_functions
|
|||||||
preexec_functions+=autojump_preexec
|
preexec_functions+=autojump_preexec
|
||||||
|
|
||||||
function j {
|
function j {
|
||||||
if [[ ${@} == -* ]]; then
|
# Cannot use =~ due to MacPorts zsh v4.2, see issue #125.
|
||||||
autojump ${@}
|
if [[ ${@} == -* ]]; then
|
||||||
return
|
autojump ${@}
|
||||||
fi
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
local new_path="$(autojump $@)"
|
local new_path="$(autojump $@)"
|
||||||
if [ -d "${new_path}" ]; then
|
if [ -d "${new_path}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user