Merge lp:~ryan.wooden/ultisnips/fix-720611 into lp:~sirver/ultisnips/trunk

Proposed by Ryan Wooden
Status: Merged
Merged at revision: 255
Proposed branch: lp:~ryan.wooden/ultisnips/fix-720611
Merge into: lp:~sirver/ultisnips/trunk
Diff against target: 33 lines (+12/-4)
1 file modified
plugin/UltiSnips/__init__.py (+12/-4)
To merge this branch: bzr merge lp:~ryan.wooden/ultisnips/fix-720611
Reviewer Review Type Date Requested Status
SirVer Pending
Review via email: mp+51685@code.launchpad.net

Description of the change

Simple fix for Bug #720611. It keeps track of which filetypes have been checked, and doesn't retry them.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Merged without modification. Thanks Ryan.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/UltiSnips/__init__.py'
2--- plugin/UltiSnips/__init__.py 2011-02-20 20:16:56 +0000
3+++ plugin/UltiSnips/__init__.py 2011-03-01 03:34:48 +0000
4@@ -1010,7 +1010,7 @@
5 if p not in self._snippets:
6 self._load_snippets_for(p)
7
8- def _find_snippets(self, ft, trigger, potentially = False):
9+ def _find_snippets(self, ft, trigger, potentially = False, seen=None):
10 """
11 Find snippets matching trigger
12
13@@ -1024,9 +1024,17 @@
14 if not snips:
15 return []
16
17- parent_results = reduce( lambda a,b: a+b,
18- [ self._find_snippets(p, trigger, potentially)
19- for p in snips.extends ], [])
20+ if not seen:
21+ seen = []
22+ seen.append(ft)
23+
24+ parent_results = []
25+
26+ for p in snips.extends:
27+ if p not in seen:
28+ seen.append(p)
29+ parent_results += self._find_snippets(p, trigger,
30+ potentially, seen)
31
32 return parent_results + snips.get_matching_snippets(
33 trigger, potentially)

Subscribers

People subscribed via source and target branches