##// END OF EJS Templates
Correct styling of ANSI patterns.
Gael Varoquaux -
Show More
@@ -69,10 +69,6 b' class PrefilterFrontEnd(LineFrontEndBase):'
69 setattr(_ip.IP, 'magic_%s' % alias_name, magic)
69 setattr(_ip.IP, 'magic_%s' % alias_name, magic)
70 # FIXME: I should create a real file-like object dedicated to this
70 # FIXME: I should create a real file-like object dedicated to this
71 # terminal
71 # terminal
72 Term.cout.flush = lambda : None
73 Term.cout.getvalue = lambda : ''
74 Term.cerr.flush = lambda : None
75 Term.cerr.getvalue = lambda : ''
76 self.shell.output_trap = SyncOutputTrap(write_out=self.write,
72 self.shell.output_trap = SyncOutputTrap(write_out=self.write,
77 write_err=self.write)
73 write_err=self.write)
78
74
@@ -207,18 +207,16 b' class ConsoleWidget(editwindow.EditWindow):'
207 self.AppendText(segment)
207 self.AppendText(segment)
208
208
209 if segments:
209 if segments:
210 ansi_tags = self.color_pat.findall(text)
210 for ansi_tag, text in zip(segments[::2], segments[1::2]):
211
212 for tag in ansi_tags:
213 i = segments.index(tag)
214 self.StartStyling(self.GetLength(), 0xFF)
211 self.StartStyling(self.GetLength(), 0xFF)
215 self.AppendText(segments[i+1])
212 self.AppendText(text)
216
213
217 if tag != '0':
214 if ansi_tag == '0':
218 self.SetStyling(len(segments[i+1]),
215 style = 0
219 self.ANSI_STYLES[tag][0])
216 else:
217 style = self.ANSI_STYLES[ansi_tag][0]
220
218
221 segments.pop(i)
219 self.SetStyling(len(text), style)
222
220
223 self.GotoPos(self.GetLength())
221 self.GotoPos(self.GetLength())
224 wx.Yield()
222 wx.Yield()
General Comments 0
You need to be logged in to leave comments. Login now