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