When you print on the last line using println!, the screen gets cleared immediately; anything println!ed on the last line will thusly not be shown.
This is because the newline character causes the TextWriter to issue calls to newline() (which increases the cursor's y-position by 8 (moving it off the screen when printing on the last line)) and carriage_return(), which resets the cursor's x-position to 0 and, if the cursor's y-position if off-screen, resets it to 0 too.
A simple fix would be to move if self.y_pos >= HEIGHT: clear() to line 341; this would clear the screen only when a character is about to be written on the next (off-screen) line.
When you print on the last line using
println!
, the screen gets cleared immediately; anythingprintln!
ed on the last line will thusly not be shown.This is because the newline character causes the
TextWriter
to issue calls tonewline()
(which increases the cursor's y-position by 8 (moving it off the screen when printing on the last line)) andcarriage_return()
, which resets the cursor's x-position to 0 and, if the cursor's y-position if off-screen, resets it to 0 too.Textwriter:
A simple fix would be to move
if self.y_pos >= HEIGHT: clear()
to line 341; this would clear the screen only when a character is about to be written on the next (off-screen) line.