##// END OF EJS Templates
Tweaks to make line-display faster.
gvaroquaux -
Show More
@@ -168,7 +168,9 b' class ConsoleWidget(editwindow.EditWindow):'
168
168
169 self.GotoPos(self.GetLength())
169 self.GotoPos(self.GetLength())
170 if refresh:
170 if refresh:
171 wx.Yield()
171 # Maybe this is faster than wx.Yield()
172 self.ProcessEvent(wx.PaintEvent())
173 #wx.Yield()
172
174
173
175
174 def new_prompt(self, prompt):
176 def new_prompt(self, prompt):
@@ -206,6 +208,15 b' class ConsoleWidget(editwindow.EditWindow):'
206 """
208 """
207 return self.GetSize()[0]/self.GetCharWidth()
209 return self.GetSize()[0]/self.GetCharWidth()
208
210
211 #--------------------------------------------------------------------------
212 # EditWindow API
213 #--------------------------------------------------------------------------
214
215 def OnUpdateUI(self, event):
216 """ Override the OnUpdateUI of the EditWindow class, to prevent
217 syntax highlighting both for faster redraw, and for more
218 consistent look and feel.
219 """
209
220
210 #--------------------------------------------------------------------------
221 #--------------------------------------------------------------------------
211 # Private API
222 # Private API
@@ -264,7 +264,8 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
264 self._out_buffer.append(text)
264 self._out_buffer.append(text)
265 self._out_buffer_lock.release()
265 self._out_buffer_lock.release()
266 if not self._buffer_flush_timer.IsRunning():
266 if not self._buffer_flush_timer.IsRunning():
267 wx.CallAfter(self._buffer_flush_timer.Start, 100) # milliseconds
267 wx.CallAfter(self._buffer_flush_timer.Start,
268 milliseconds=100, oneShot=True)
268
269
269
270
270 #--------------------------------------------------------------------------
271 #--------------------------------------------------------------------------
@@ -294,12 +295,14 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
294
295
295 def capture_output(self):
296 def capture_output(self):
296 __builtin__.raw_input = self.raw_input
297 __builtin__.raw_input = self.raw_input
298 self.SetLexer(stc.STC_LEX_NULL)
297 PrefilterFrontEnd.capture_output(self)
299 PrefilterFrontEnd.capture_output(self)
298
300
299
301
300 def release_output(self):
302 def release_output(self):
301 __builtin__.raw_input = self.__old_raw_input
303 __builtin__.raw_input = self.__old_raw_input
302 PrefilterFrontEnd.release_output(self)
304 PrefilterFrontEnd.release_output(self)
305 self.SetLexer(stc.STC_LEX_PYTHON)
303
306
304
307
305 def after_execute(self):
308 def after_execute(self):
@@ -438,6 +441,18 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
438
441
439
442
440 #--------------------------------------------------------------------------
443 #--------------------------------------------------------------------------
444 # EditWindow API
445 #--------------------------------------------------------------------------
446
447 def OnUpdateUI(self, event):
448 """ Override the OnUpdateUI of the EditWindow class, to prevent
449 syntax highlighting both for faster redraw, and for more
450 consistent look and feel.
451 """
452 if not self._input_state == 'readline':
453 ConsoleWidget.OnUpdateUI(self, event)
454
455 #--------------------------------------------------------------------------
441 # Private API
456 # Private API
442 #--------------------------------------------------------------------------
457 #--------------------------------------------------------------------------
443
458
@@ -458,7 +473,7 b' class WxController(ConsoleWidget, PrefilterFrontEnd):'
458 self._out_buffer = []
473 self._out_buffer = []
459 self._out_buffer_lock.release()
474 self._out_buffer_lock.release()
460 self.write(''.join(_out_buffer), refresh=False)
475 self.write(''.join(_out_buffer), refresh=False)
461 self._buffer_flush_timer.Stop()
476
462
477
463 def _colorize_input_buffer(self):
478 def _colorize_input_buffer(self):
464 """ Keep the input buffer lines at a bright color.
479 """ Keep the input buffer lines at a bright color.
General Comments 0
You need to be logged in to leave comments. Login now