branch : pmacs2
This commit is contained in:
moculus 2009-03-16 17:53:07 +00:00
parent e2ef7c927f
commit be04932d91
2 changed files with 7 additions and 5 deletions

View File

@ -51,7 +51,7 @@ class XTermBuffer(Buffer, XTerm):
XTerm.term_do_newline(self)
#p = w.logical_cursor()
#self.insert_string(p, "XYZ", act=ACT_NONE, force=True)
def term_do_style(self, s):
def term_do_style(self):
pass
def term_do_clear(self):
self.set_lines([''], force=True)

View File

@ -127,8 +127,7 @@ class XTerm(Dumb):
num_re = re.compile('^([a-zA-Z0-9]+)#(.+)$')
str_re = re.compile('^([a-zA-Z0-9]+)=(.+)$')
style_re = re.compile(r'^\033\[[0-9;]+m')
#style_re = re.compile(r'^\033\[1m')
style_re = re.compile(r'^\033\[[0-9;]*m')
text_signal_re = re.compile(r'^\033\][0-9]+;.+\007')
cup_re = re.compile(r'^\033\[[0-9]+;[0-9]+H')
@ -184,7 +183,7 @@ class XTerm(Dumb):
m = self.str_re.match(field)
assert m, "huh?? %r" % field
name, val = m.groups()
if val.startswith('\\E['):
if len(val) > 3 and val[:2] == '\\E[' and val[3] in '0123456789':
continue
elif val.startswith('\\E'):
self.sequences[val.replace('\\E', '\033')] = name
@ -193,6 +192,9 @@ class XTerm(Dumb):
def parse_style(self, s):
# starts with '\033[' and ends with 'm'
s2 = s[2:-1]
if s2 == '':
l = ['0']
else:
l = s2.split(';')
for n in l:
if n == '0':