Skip to content

Commit

Permalink
fix issue #192: PRINT CHR$(10) should not connect/wrap lines
Browse files Browse the repository at this point in the history
  • Loading branch information
robhagemans committed Jul 6, 2022
1 parent 01f11b3 commit 971110c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pcbasic/basic/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,10 @@ def write(self, s, do_echo=True):
# TAB
num = (8 - (col - 1 - 8 * int((col-1) // 8)))
self._text_screen.write_chars(b' ' * num, do_scroll_down=False)
elif c == b'\n':
# LF
# exclude CR/LF
if last != b'\r':
# LF connects lines like word wrap
self._text_screen.set_wrap(row, True)
self._text_screen.set_pos(row + 1, 1, scroll_ok=True)
elif c == b'\r':
# CR
elif c == b'\n' or c == b'\r':
# CR or LF
# note that a PRINTed LF chr$(10) does not cause a wrapped/connected line
# in contrast to a typed Ctrl+J
self._text_screen.set_wrap(row, False)
self._text_screen.set_pos(row + 1, 1, scroll_ok=True)
elif c == b'\a':
Expand Down

0 comments on commit 971110c

Please sign in to comment.