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

Fix #110, autojump_ignore_case now working properly

This commit is contained in:
William Ting 2012-05-08 09:08:50 -10:00
parent 83e01c5251
commit 0818bf8164

View File

@ -29,7 +29,7 @@ import shutil
import sys import sys
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
VERSION = 'release-v20-4' VERSION = 'release-v20-5'
MAX_KEYWEIGHT = 1000 MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000 MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__' COMPLETION_SEPARATOR = '__'
@ -43,11 +43,11 @@ else:
CONFIG_DIR = os.path.join(xdg_data_dir, 'autojump') CONFIG_DIR = os.path.join(xdg_data_dir, 'autojump')
KEEP_ALL_ENTRIES = False KEEP_ALL_ENTRIES = False
if 'AUTOJUMP_KEEP_ALL_ENTRIES' in os.environ and os.environ.get('AUTOJUMP_KEEP_ALL_ENTRIES') == 1: if 'AUTOJUMP_KEEP_ALL_ENTRIES' in os.environ and os.environ.get('AUTOJUMP_KEEP_ALL_ENTRIES') == '1':
KEEP_ALL_ENTRIES = True KEEP_ALL_ENTRIES = True
ALWAYS_IGNORE_CASE = False ALWAYS_IGNORE_CASE = False
if 'AUTOJUMP_IGNORE_CASE' in os.environ and os.environ.get('AUTOJUMP_IGNORE_CASE') == 1: if 'AUTOJUMP_IGNORE_CASE' in os.environ and os.environ.get('AUTOJUMP_IGNORE_CASE') == '1':
ALWAYS_IGNORE_CASE = True ALWAYS_IGNORE_CASE = True
if CONFIG_DIR == os.path.expanduser('~'): if CONFIG_DIR == os.path.expanduser('~'):
@ -379,6 +379,7 @@ def shell_utility():
else: else:
max_matches = 1 max_matches = 1
results = []
if not ALWAYS_IGNORE_CASE: if not ALWAYS_IGNORE_CASE:
results = find_matches(db, patterns, max_matches, False) results = find_matches(db, patterns, max_matches, False)