parent
b033788a84
commit
95526f36ae
10
method.py
10
method.py
|
@ -1346,6 +1346,7 @@ class CloseTag(Method):
|
|||
highlighter = buffer.highlights[w.mode.name()]
|
||||
tokens = highlighter.tokens
|
||||
|
||||
# REFACTOR: we have methods in window to do this now
|
||||
i = 0
|
||||
while i < len(tokens[y]):
|
||||
token = tokens[y][i]
|
||||
|
@ -1361,15 +1362,16 @@ class CloseTag(Method):
|
|||
while y >= 0:
|
||||
while i >= 0 and i < len(tokens[y]):
|
||||
token = tokens[y][i]
|
||||
n = token.name
|
||||
s = token.string
|
||||
if token.string in self.closetags:
|
||||
if n in w.mode.closetokens and s in w.mode.closetags:
|
||||
tag_stack.append(s)
|
||||
elif token.string in self.opentags:
|
||||
if tag_stack[-1] == self.opentags[s]:
|
||||
elif n in w.mode.opentokens and s in w.mode.opentags:
|
||||
if tag_stack[-1] == w.mode.opentags[s]:
|
||||
del tag_stack[-1]
|
||||
else:
|
||||
app.set_error("tag mismatch; got %r expected %r" %
|
||||
s, self.close_tags[tag_stack[-1]])
|
||||
(s, w.mode.closetags[tag_stack[-1]]))
|
||||
return
|
||||
if len(tag_stack) == 0:
|
||||
p = Point(token.x, y)
|
||||
|
|
|
@ -10,7 +10,7 @@ class MetadataGrammar(Grammar):
|
|||
|
||||
class BlameGrammar(Grammar):
|
||||
rules = [
|
||||
RegionRule(r'metadata', r'^[0-9\.]+', MetadataGrammar, r'[0-9]{4}-[0-9]{2}-[0-9]{2}'),
|
||||
RegionRule(r'metadata', r'^[0-9\.]+', MetadataGrammar, r'(?:[0-9]{4}-[0-9]{2}-[0-9]{2}|[0-9]{2}-[A-Z][a-z]{2}-[0-9]{2})'),
|
||||
PatternRule(r'data', r'.+$'),
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue