@@ -595,6 +595,9 @@ def _insert_fullchar_at(self, row, col, c, attr):
595595 else :
596596 therow .end = col
597597 self ._redraw_row (col - 1 , row )
598+ if therow .wrap and therow .end == self .mode .width :
599+ self .scroll_down (row + 1 )
600+ therow .wrap = True
598601 return True
599602 else :
600603 # pushing the end of the row past the screen edge
@@ -627,6 +630,7 @@ def line_feed(self):
627630 # adjust end of line and wrapping flag - LF connects lines like word wrap
628631 self .text .pages [self .apagenum ].row [self .current_row - 1 ].end = self .current_col - 1
629632 self .text .pages [self .apagenum ].row [self .current_row - 1 ].wrap = True
633+ # cursor stays in place after line feed!
630634 else :
631635 # find last row in logical line
632636 end = self .text .find_end_of_line (self .apagenum , self .current_row )
@@ -641,8 +645,13 @@ def line_feed(self):
641645 # self.current_row has changed, don't use row var
642646 if self .current_row < self .mode .height :
643647 self .scroll_down (self .current_row + 1 )
644- self .text .pages [self .apagenum ].row [self .current_row ].wrap = True
645- # cursor stays in place after line feed!
648+ # if we were already a wrapping row, make sure the new empty row wraps
649+ #if self.text.pages[self.apagenum].row[self.current_row-1].wrap:
650+ # self.text.pages[self.apagenum].row[self.current_row].wrap = True
651+ # ensure the current row now wraps
652+ self .text .pages [self .apagenum ].row [self .current_row - 1 ].wrap = True
653+ # cursor moves to start of next line
654+ self .set_pos (self .current_row + 1 , 1 )
646655
647656 ###########################################################################
648657 # vpage text retrieval
0 commit comments