From 1091875ca189ed7817055a26e74e86193cfc2ecb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 18 Apr 2013 13:38:49 -0700 Subject: [PATCH] Index into array instead of removing matchers --- src/app/text-mate-scope-selector-matchers.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/text-mate-scope-selector-matchers.coffee b/src/app/text-mate-scope-selector-matchers.coffee index 38ac13de8..1d9a017df 100644 --- a/src/app/text-mate-scope-selector-matchers.coffee +++ b/src/app/text-mate-scope-selector-matchers.coffee @@ -32,9 +32,10 @@ class PathMatcher @matchers.push(matcher[1]) for matcher in others matches: (scopes) -> - matcher = @matchers.shift() + index = 0 + matcher = @matchers[index] for scope in scopes - matcher = @matchers.shift() if matcher.matches(scope) + matcher = @matchers[++index] if matcher.matches(scope) return true unless matcher? false