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

Never jump to pwd, use next best option.

This regression bug was introduced when adding the KEEP_SYMLINKS option. The
current_dir was always set to '.' which would never match any database entries.
This commit is contained in:
William Ting 2012-12-17 12:35:33 -06:00
parent f0e45478a7
commit a99183bf8b

View File

@ -34,7 +34,7 @@ import re
import shutil import shutil
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
VERSION = 'release-v21.2.0' VERSION = 'release-v21.2.1'
MAX_KEYWEIGHT = 1000 MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000 MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__' COMPLETION_SEPARATOR = '__'
@ -336,9 +336,6 @@ def find_matches(db, patterns, max_matches=1, ignore_case=False, fuzzy=False):
Find max_matches paths that match the pattern, and add them to the result_list. Find max_matches paths that match the pattern, and add them to the result_list.
""" """
try: try:
if KEEP_SYMLINKS:
current_dir = decode(os.curdir)
else:
current_dir = decode(os.path.realpath(os.curdir)) current_dir = decode(os.path.realpath(os.curdir))
except OSError: except OSError:
current_dir = None current_dir = None
@ -372,7 +369,7 @@ def find_matches(db, patterns, max_matches=1, ignore_case=False, fuzzy=False):
for path, _ in dirs: for path, _ in dirs:
# avoid jumping to current directory # avoid jumping to current directory
if current_dir == path : if current_dir == decode(os.path.realpath(path)) :
continue continue
found, tmp = True, path found, tmp = True, path