Skip to content

Commit

Permalink
Merge pull request #25 from gerryqd/master
Browse files Browse the repository at this point in the history
Modify code in 'filename_score' to support python 2.4
  • Loading branch information
FelikZ committed Jan 13, 2016
2 parents 08b98ff + 574c039 commit 8a80326
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autoload/pymatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def CtrlPPyMatch():
def filename_score(line):
# get filename via reverse find to improve performance
slashPos = line.rfind('/')
line = line if slashPos == -1 else line[slashPos + 1:]

if slashPos != -1:
line = line[slashPos + 1:]

lineLower = line.lower()
result = prog.search(lineLower)
Expand All @@ -52,7 +54,6 @@ def filename_score(line):

return 0


def path_score(line):
lineLower = line.lower()
result = prog.search(lineLower)
Expand All @@ -63,7 +64,6 @@ def path_score(line):

return 0


if mmode == 'filename-only':
res = [(filename_score(line), line) for line in items]

Expand All @@ -86,4 +86,4 @@ def path_score(line):

vim.command("let s:regex = '%s'" % regex)
vim.command('let s:rez = [%s]' % ','.join(vimrez))

0 comments on commit 8a80326

Please sign in to comment.