Handle begin/end patterns with no name or contentName

I'm looking at you ruby.
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-09-07 18:54:54 -07:00
parent 12e2fbdb14
commit 2d3c06b86d

View File

@@ -31,7 +31,7 @@ class TextMateGrammar
position = 0
loop
scopes = _.pluck(stack, "scopeName")
scopes = scopesFromStack(stack)
if line.length == 0
tokens = [{value: "", scopes: scopes}]
@@ -153,7 +153,7 @@ class Pattern
{ match: @regex.getCaptureIndices(line, position), pattern: this }
handleMatch: (stack, line, captureIndices) ->
scopes = _.pluck(stack, "scopeName")
scopes = scopesFromStack(stack)
scopes.push(@scopeName) if @scopeName and not @popRule
if @captures
@@ -220,3 +220,6 @@ class Pattern
shiftCapture = (captureIndices) ->
[captureIndices.shift(), captureIndices.shift(), captureIndices.shift()]
scopesFromStack = (stack) ->
_.compact(_.pluck(stack, "scopeName"))