@@ -1018,7 +1018,7 @@ def paint(self, about_to_exit=False, user_quit=False):
1018
1018
else :
1019
1019
arr = FSArray (0 , width )
1020
1020
#TODO test case of current line filling up the whole screen (there aren't enough rows to show it)
1021
- if self .inconsistent_history == False & current_line_start_row >= 0 :
1021
+ if self .inconsistent_history == False and current_line_start_row >= 0 :
1022
1022
logger .debug ("start %i" ,current_line_start_row )
1023
1023
history = paint .paint_history (current_line_start_row , width , self .lines_for_display )
1024
1024
arr [:history .height ,:history .width ] = history
@@ -1031,7 +1031,7 @@ def paint(self, about_to_exit=False, user_quit=False):
1031
1031
msg = INCONSISTENT_HISTORY_MSG
1032
1032
arr [0 , 0 :min (len (msg ), width )] = [msg [:width ]]
1033
1033
# self.scroll_offset -= 1
1034
-
1034
+
1035
1035
current_line_start_row = len (self .lines_for_display )- max (- 1 , self .scroll_offset )
1036
1036
self .inconsistent_history = False
1037
1037
if current_line_start_row < 0 : #if current line trying to be drawn off the top of the screen
@@ -1244,19 +1244,16 @@ def reevaluate(self, insert_into_history=False):
1244
1244
self .process_event (events .RefreshRequestEvent ())
1245
1245
sys .stdin = self .stdin
1246
1246
self .reevaluating = False
1247
-
1248
- num_lines_onscreen = len (self .lines_for_display ) - max (0 , self .scroll_offset )
1249
- old_display_lines_offscreen = []
1250
- display_lines_offscreen = []
1251
- if old_display_lines [:len (self .display_lines ) - num_lines_onscreen ]!= self .display_lines :
1252
- old_display_lines_offscreen = old_display_lines [:len (self .display_lines ) - num_lines_onscreen ]
1253
- display_lines_offscreen = self .display_lines [:- num_lines_onscreen ]
1254
-
1255
- if old_display_lines_offscreen != display_lines_offscreen and self .history_messed_up == False :
1256
- self .scroll_offset = self .scroll_offset - (len (old_display_lines )- len (self .display_lines ))
1257
1247
1248
+ num_lines_onscreen = len (self .lines_for_display ) - max (0 , self .scroll_offset )
1249
+ display_lines_offscreen = self .display_lines [:len (self .display_lines ) - num_lines_onscreen ]
1250
+ old_display_lines_offscreen = old_display_lines [:len (self .display_lines ) - num_lines_onscreen ]
1251
+ logger .debug ('old_display_lines_offscreen %r' , old_display_lines_offscreen )
1252
+ logger .debug ('display_lines_offscreen %r' , display_lines_offscreen )
1253
+ if old_display_lines_offscreen [:len (display_lines_offscreen )] != display_lines_offscreen and self .history_messed_up == False :
1254
+ self .scroll_offset = self .scroll_offset - (len (old_display_lines )- len (self .display_lines ))
1258
1255
self .inconsistent_history = True
1259
- #self.scroll_offset = self.scroll_offset - max(-1,(len(old_display_lines_offscreen)-len(display_lines_offscreen)+1) )
1256
+ logger . debug ( 'after rewind, self.inconsistent_history is %r' , self . inconsistent_history )
1260
1257
1261
1258
self .cursor_offset = 0
1262
1259
self .current_line = ''
0 commit comments