mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Handle begin/end patterns with no name or contentName
I'm looking at you ruby.
This commit is contained in:
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user