Use smartcase in search.
This commit is contained in:
parent
b114257bdd
commit
d16c92c681
@ -97,8 +97,12 @@ class SearchPassService(dbus.service.Object):
|
|||||||
if filename[-4:] != '.gpg':
|
if filename[-4:] != '.gpg':
|
||||||
continue
|
continue
|
||||||
path = path_join(dir_path, filename)[:-4]
|
path = path_join(dir_path, filename)[:-4]
|
||||||
for name in path.split('/'):
|
for part in path.split('/'):
|
||||||
matcher.set_seq1(name)
|
# smartcase: be case insensitive unless uppercase
|
||||||
|
# characters are used in the search
|
||||||
|
if name.islower():
|
||||||
|
part = part.lower()
|
||||||
|
matcher.set_seq1(part)
|
||||||
score = matcher.ratio()
|
score = matcher.ratio()
|
||||||
if score >= 0.5 and \
|
if score >= 0.5 and \
|
||||||
(path not in matches or score > matches[path]):
|
(path not in matches or score > matches[path]):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user