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

Fix no jump when query begins with - in Zsh

Without this commit, the following command prints the
path found by autojump, but doesn't actually jump because
the Zsh script assumes we're passing an option to j():

    j -- -tools

The -- is needed; otherwise `-tools` would be interpreted as
a (bad) autojump option.
This commit is contained in:
Philippe Proulx 2014-09-24 12:35:17 -04:00
parent b60932616b
commit d12378fc15

View File

@ -42,7 +42,7 @@ chpwd_functions+=autojump_chpwd
# default autojump command
j() {
if [[ ${@} == -* ]]; then
if [[ ${@} == -* && ! (${#} -eq 2 && ${1} == '--') ]]; then
autojump ${@}
return
fi