diff --git a/spec/app/text-mate-scope-selector-spec.coffee b/spec/app/text-mate-scope-selector-spec.coffee index 7ea2bf547..35b4de613 100644 --- a/spec/app/text-mate-scope-selector-spec.coffee +++ b/spec/app/text-mate-scope-selector-spec.coffee @@ -16,6 +16,8 @@ describe "TextMateScopeSelector", -> expect(new TextMateScopeSelector('a').matches(['abc'])).toBeFalsy() expect(new TextMateScopeSelector('a.b-c').matches(['a.b-c.d'])).toBeTruthy() expect(new TextMateScopeSelector('a.b').matches(['a.b-d'])).toBeFalsy() + expect(new TextMateScopeSelector('c++').matches(['c++'])).toBeTruthy() + expect(new TextMateScopeSelector('c++').matches(['c'])).toBeFalsy() it "matches disjunction", -> expect(new TextMateScopeSelector('a | b').matches(['b'])).toBeTruthy() diff --git a/src/app/text-mate-scope-selector-pattern.pegjs b/src/app/text-mate-scope-selector-pattern.pegjs index e1dedb1c4..9965d6337 100644 --- a/src/app/text-mate-scope-selector-pattern.pegjs +++ b/src/app/text-mate-scope-selector-pattern.pegjs @@ -7,7 +7,7 @@ start = _ selector:(selector) _ { } segment - = _ segment:([a-zA-Z0-9]+[a-zA-Z0-9-]*) _ { + = _ segment:([a-zA-Z0-9+]+[a-zA-Z0-9-+]*) _ { return new matchers.SegmentMatcher(segment); }