From 95526f36ae98d10223fc96a0ef9b512cfa0aee30 Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 23 Jul 2007 21:07:43 +0000 Subject: [PATCH] blame bugfix and close-tag bugfix --HG-- branch : pmacs2 --- method.py | 10 ++++++---- mode/blame.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/method.py b/method.py index ebc8968..fdade4b 100644 --- a/method.py +++ b/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) diff --git a/mode/blame.py b/mode/blame.py index 1ef5cd6..541f299 100644 --- a/mode/blame.py +++ b/mode/blame.py @@ -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'.+$'), ]