mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
Create synthetic iterator boundaries between open and close tags
If no non-negative integer exists between an open and close tag code, we still need to report a boundary there, since close tags always have to come first at any given iterator position. :pear:ed with @as-cii
This commit is contained in:
@@ -28,7 +28,11 @@ class TokenizedBufferIterator
|
||||
else
|
||||
scopeName = @grammarRegistry.scopeForId(tag)
|
||||
if tag % 2 is 0
|
||||
@closeTags.push(scopeName)
|
||||
if @openTags.length > 0
|
||||
@tagIndex = index
|
||||
break
|
||||
else
|
||||
@closeTags.push(scopeName)
|
||||
else
|
||||
@openTags.push(scopeName)
|
||||
|
||||
@@ -56,7 +60,10 @@ class TokenizedBufferIterator
|
||||
else
|
||||
scopeName = @grammarRegistry.scopeForId(tag)
|
||||
if tag % 2 is 0
|
||||
@closeTags.push(scopeName)
|
||||
if @openTags.length > 0
|
||||
break
|
||||
else
|
||||
@closeTags.push(scopeName)
|
||||
else
|
||||
@openTags.push(scopeName)
|
||||
@tagIndex++
|
||||
|
||||
Reference in New Issue
Block a user