1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

use zsh change directory hook rather than pre-command hook

This commit is contained in:
William Ting 2013-02-01 15:00:26 -06:00
parent 214440af65
commit ae978d3319
2 changed files with 4 additions and 5 deletions

View File

@ -34,7 +34,7 @@ import re
import shutil
from tempfile import NamedTemporaryFile
VERSION = 'release-v21.4.1'
VERSION = 'release-v21.4.2'
MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__'

View File

@ -23,8 +23,7 @@ command -v brew &>/dev/null \
&& [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \
&& fpath=(`brew --prefix`/share/zsh/site-functions ${fpath})
# TODO: switch this to a chpwd hook instead (2013.02.01_1319, ting)
function autojump_preexec() {
function autojump_chpwd() {
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]; then
_PWD_ARGS=""
else
@ -33,8 +32,8 @@ function autojump_preexec() {
{ (autojump -a "$(pwd ${_PWD_ARGS})"&)>/dev/null 2>>|${AUTOJUMP_DATA_DIR}/.autojump_errors ; } 2>/dev/null
}
typeset -ga preexec_functions
preexec_functions+=autojump_preexec
typeset -ga chpwd_functions
chpwd_functions+=autojump_chpwd
function j {
# Cannot use =~ due to MacPorts zsh v4.2, see issue #125.