Skip to content

Commit

Permalink
Better match highlight regex
Browse files Browse the repository at this point in the history
  • Loading branch information
raghur committed Sep 28, 2018
1 parent 5259db4 commit a3028e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rplugin/python3/denite/filter/matcher/fruzzymatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def scoreMatchesProxy(self, q, c, limit, key=None, ispath=True):
return fruzzy.scoreMatches(q, c, limit, key, ispath)

def convert_pattern(self, input_str):
# return convert2fuzzy_pattern(input_str)
p = convert2fuzzy_pattern(input_str)
if not input_str:
return input_str
pat = ""
for c in input_str[:-1]:
pat = pat + "%s[^%s]{-}" % (c, c)
p = pat + input_str[-1]
# p = convert2fuzzy_pattern(input_str)
# self.debug("pattern: %s : %s" % (input_str, p))
return p

0 comments on commit a3028e7

Please sign in to comment.