updated tag matching

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-07-17 08:13:56 +00:00
parent 13c36744ec
commit e691606a33
1 changed files with 5 additions and 3 deletions

View File

@ -1328,7 +1328,6 @@ class CloseTag(Method):
return return
i += 1 i += 1
if i >= len(tokens[y]): if i >= len(tokens[y]):
#app.set_error('none found: %d' % (i))
return return
tag_stack = [] tag_stack = []
@ -1347,12 +1346,15 @@ class CloseTag(Method):
return return
if len(tag_stack) == 0: if len(tag_stack) == 0:
p = Point(token.x, y) p = Point(token.x, y)
w.set_active_point(p, msg='match found at (%(y)d, %(x)d)') s = w.buffer.lines[p.y][:p.x+1]
if len(s) > 60:
s = "..." + s[-60:]
msg = 'matches %r' % s
w.set_active_point(p, msg)
return return
i -= 1 i -= 1
y -= 1 y -= 1
i = len(tokens[y]) - 1 i = len(tokens[y]) - 1
#app.set_error('tag mismatch: no tag found')
class CloseParen(CloseTag): class CloseParen(CloseTag):
mytag = ')' mytag = ')'