Skip to content

Commit c2da081

Browse files
committed
move cursor to next row if LF (ctrl-J) entered past the end of the line
1 parent 2a7790e commit c2da081

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pcbasic/basic/display/textscreen.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -642,7 +646,8 @@ def line_feed(self):
642646
if self.current_row < self.mode.height:
643647
self.scroll_down(self.current_row+1)
644648
self.text.pages[self.apagenum].row[self.current_row].wrap = True
645-
# cursor stays in place after line feed!
649+
# cursor moves to start of next line
650+
self.set_pos(self.current_row+1, 1)
646651

647652
###########################################################################
648653
# vpage text retrieval

0 commit comments

Comments
 (0)