@@ -263,7 +263,10 @@ def process_event(self, e):
263263 self .run_code_and_maybe_finish ()
264264 elif isinstance (e , events .WindowChangeEvent ):
265265 logging .debug ('window change to %d %d' , e .width , e .height )
266+ #TODO when window gets larger, history is eaten up
267+ self .scroll_offset -= e .cursor_dy
266268 self .width , self .height = e .width , e .height
269+
267270 elif self .status_bar .has_focus :
268271 return self .status_bar .process_event (e )
269272 elif self .stdin .has_focus :
@@ -714,6 +717,7 @@ def _paint(self, about_to_exit=False, user_quit=False):
714717 if show_status_bar :
715718 min_height -= 1
716719
720+
717721 current_line_start_row = len (self .lines_for_display ) - max (0 , self .scroll_offset )
718722 if self .request_paint_to_clear_screen : # or show_status_bar and about_to_exit ?
719723 self .request_paint_to_clear_screen = False
@@ -726,7 +730,6 @@ def _paint(self, about_to_exit=False, user_quit=False):
726730 #TODO test case of current line filling up the whole screen (there aren't enough rows to show it)
727731
728732 if current_line_start_row < 0 : #if current line trying to be drawn off the top of the screen
729- #assert True, 'no room for current line: contiguity of history broken!'
730733 logging .debug ('#<---History contiguity broken by rewind--->' )
731734 msg = "#<---History contiguity broken by rewind--->"
732735 arr [0 , 0 :min (len (msg ), width )] = [msg [:width ]]
0 commit comments