equal
deleted
inserted
replaced
340 def findlines(self, l, linenum): |
340 def findlines(self, l, linenum): |
341 # looks through the hash and finds candidate lines. The |
341 # looks through the hash and finds candidate lines. The |
342 # result is a list of line numbers sorted based on distance |
342 # result is a list of line numbers sorted based on distance |
343 # from linenum |
343 # from linenum |
344 |
344 |
345 try: |
345 cand = self.hash.get(l, []) |
346 cand = self.hash[l] |
|
347 except: |
|
348 return [] |
|
349 |
|
350 if len(cand) > 1: |
346 if len(cand) > 1: |
351 # resort our list of potentials forward then back. |
347 # resort our list of potentials forward then back. |
352 cand.sort(key=lambda x: abs(x - linenum)) |
348 cand.sort(key=lambda x: abs(x - linenum)) |
353 return cand |
349 return cand |
354 |
350 |