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:
parent
214440af65
commit
ae978d3319
@ -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 = '__'
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user