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

refactor a few lines for legibility

This commit is contained in:
William Ting 2012-11-21 17:48:12 -06:00
parent fd287eab04
commit 2554fc7ed4
2 changed files with 9 additions and 5 deletions

View File

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

View File

@ -49,17 +49,21 @@ if [ -d ~/.autojump/ ]; then
fi fi
export AUTOJUMP_HOME=${HOME} export AUTOJUMP_HOME=${HOME}
if [ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ] if [ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]; then
then
_PWD_ARGS="" _PWD_ARGS=""
else else
_PWD_ARGS="-P" _PWD_ARGS="-P"
fi fi
AUTOJUMP='{ [[ "$AUTOJUMP_HOME" == "$HOME" ]] && (autojump -a "$(pwd ${_PWD_ARGS})"&)>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/.autojump_errors";} 2>/dev/null'
autojump_add_to_database() {
if [[ "${AUTOJUMP_HOME}" == "${HOME}" ]]; then
autojump -a "$(pwd ${_PWD_ARGS})" 1>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/.autojump_errors"
fi
}
case $PROMPT_COMMAND in case $PROMPT_COMMAND in
*autojump*) ;; *autojump*) ;;
*) export PROMPT_COMMAND="$AUTOJUMP ; ${PROMPT_COMMAND:-:}";; *) export PROMPT_COMMAND="autojump_add_to_database; ${PROMPT_COMMAND:-:}";;
esac esac
function j { function j {