瀏覽代碼

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

pull/141/head
William Ting 12 年之前
父節點
當前提交
ca8763aa02
共有 3 個文件被更改,包括 9 次插入8 次删除
  1. +1
    -1
      bin/autojump
  2. +1
    -1
      bin/autojump.bash
  3. +7
    -6
      bin/autojump.zsh

+ 1
- 1
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 = '__'

+ 1
- 1
bin/autojump.bash 查看文件

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

+ 7
- 6
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

Loading…
取消
儲存